diff options
author | Guido van Rossum <guido@python.org> | 1997-10-20 23:46:54 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-10-20 23:46:54 (GMT) |
commit | 4e8ef5fcd3e44b848710beac4e9211d4892bdf0f (patch) | |
tree | 62f5bd4e80b8bd231653d5dc3aa7659b934285e5 /Lib/test | |
parent | 1510565cb5efb22604bd81696ebc12ad5781017e (diff) | |
download | cpython-4e8ef5fcd3e44b848710beac4e9211d4892bdf0f.zip cpython-4e8ef5fcd3e44b848710beac4e9211d4892bdf0f.tar.gz cpython-4e8ef5fcd3e44b848710beac4e9211d4892bdf0f.tar.bz2 |
Catch KeyboardInterrupt separately and propagate it, instead of
reporting a "crash".
Use sys.exc_info() instead of sys.exc_type and sys.exc_value.
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/regrtest.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 7e1003c..abd40a6 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -138,11 +138,14 @@ def runtest(test, generate, verbose): sys.stdout = save_stdout except ImportError, msg: return -1 + except KeyboardInterrupt, v: + raise KeyboardInterrupt, v, sys.exc_info()[2] except test_support.TestFailed, msg: print "test", test, "failed --", msg return 0 except: - print "test", test, "crashed --", sys.exc_type, ":", sys.exc_value + type, value = sys.exc_info()[:2] + print "test", test, "crashed --", type, ":", value if verbose: traceback.print_exc(file=sys.stdout) return 0 |