summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-10-05 13:42:01 (GMT)
committerSteven Knight <knight@baldmt.com>2008-10-05 13:42:01 (GMT)
commit7719d579dddb84c57033c1fdf3a02268abba2204 (patch)
tree37673009efc7e338128252b3b249bb18fe40652c
parent091232eb5b0dde383133d38aee899fa4cfa9555c (diff)
downloadSCons-7719d579dddb84c57033c1fdf3a02268abba2204.zip
SCons-7719d579dddb84c57033c1fdf3a02268abba2204.tar.gz
SCons-7719d579dddb84c57033c1fdf3a02268abba2204.tar.bz2
Fix a block in Script/Main.py that could swallow KeyboardInterrupt
exceptions. Fix the script that analyzes our try:-except: block so it recognizes that "except Exception, e:" is equivalent to "except:".
-rw-r--r--src/engine/SCons/Script/Main.py2
-rw-r--r--src/test_interrupts.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 048dfdd..22ca331 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -216,6 +216,8 @@ class BuildTask(SCons.Taskmaster.Task):
sys.stderr.write("\n")
try:
raise SCons.Errors.BuildError(t, errstr)
+ except KeyboardInterrupt:
+ raise
except:
self.exception_set()
self.do_failed()
diff --git a/src/test_interrupts.py b/src/test_interrupts.py
index 6fb82b4..eee1f0c 100644
--- a/src/test_interrupts.py
+++ b/src/test_interrupts.py
@@ -83,7 +83,7 @@ else:
tryexc_pat = re.compile(
r'^(?P<try_or_except>(?P<indent> *)(try|except)( [^\n]*)?:.*)',re.MULTILINE)
keyboardint_pat = re.compile(r' *except +([^,],)*KeyboardInterrupt([ ,][^\n]*)?:[^\n]*')
-exceptall_pat = re.compile(r' *except *:[^\n]*')
+exceptall_pat = re.compile(r' *except(?: *| +Exception *, *[^: ]+):[^\n]*')
uncaughtKeyboardInterrupt = 0
for f in files: