Subject: [StGit PATCH 6/8] Simplify debug level error checking

From: Karl Hasselström <[email-masked]>
Date: Mon, 08 Oct 2007 01:17:47 +0200

Signed-off-by: Karl Hasselström <[email-masked]>

---

 stgit/main.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/stgit/main.py b/stgit/main.py
index f54330d..19ba2bd 100644
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -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)