From 4e8ef5fcd3e44b848710beac4e9211d4892bdf0f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 20 Oct 1997 23:46:54 +0000 Subject: Catch KeyboardInterrupt separately and propagate it, instead of reporting a "crash". Use sys.exc_info() instead of sys.exc_type and sys.exc_value. --- Lib/test/regrtest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v0.12