mirror of https://github.com/python/cpython
Catch KeyboardInterrupt separately and propagate it, instead of
reporting a "crash". Use sys.exc_info() instead of sys.exc_type and sys.exc_value.
This commit is contained in:
parent
1510565cb5
commit
4e8ef5fcd3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue