From: Karl Hasselström Date: Sun, 07 Oct 2007 23:17:47 GMT Subject: [StGit PATCH 6/8] Simplify debug level error checking Message-ID: <20071007231747.12626.26660.stgit@yoghurt> In-Reply-To: <20071007231446.12626.14259.stgit@yoghurt> Signed-off-by: Karl Hasselström --- 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)