chiark / gitweb /
Simplify debug level error checking
[stgit] / stgit / main.py
index f54330d3e4f6dc12fa7cd2e1173f73b892884192..19ba2bd63e000a44125197b0a6995b3a76272501 100644 (file)
@@ -261,9 +261,7 @@ def main():
     from stgit.stack import Series
 
     try:
-        debug_level = int(os.environ['STGIT_DEBUG_LEVEL'])
-    except KeyError:
-        debug_level = 0
+        debug_level = int(os.environ.get('STGIT_DEBUG_LEVEL', 0))
     except ValueError:
         out.error('Invalid STGIT_DEBUG_LEVEL environment variable')
         sys.exit(1)