From 4200335fdd4b2b0902c128c781594ebd6c42b821 Mon Sep 17 00:00:00 2001 Message-Id: <4200335fdd4b2b0902c128c781594ebd6c42b821.1715143272.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 7 Oct 2007 15:09:11 +0200 Subject: [PATCH] Simplify debug level error checking MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Karl Hasselström Signed-off-by: Karl Hasselström --- stgit/main.py | 4 +--- 1 file changed, 1 insertion(+), 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) -- [mdw]