From: Guido van Rossum Date: Mon, 20 Oct 1997 23:46:54 +0000 (+0000) Subject: Catch KeyboardInterrupt separately and propagate it, instead of X-Git-Tag: v1.5b1~176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e8ef5fcd3e44b848710beac4e9211d4892bdf0f;p=python Catch KeyboardInterrupt separately and propagate it, instead of reporting a "crash". Use sys.exc_info() instead of sys.exc_type and sys.exc_value. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 7e1003c70b..abd40a6399 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