mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Instead of printing the exception when you interrupt a test (Ctrl-C),
print the status so far and suppress printing the exception (but still exit).
This commit is contained in:
parent
a829313d7b
commit
14ca327f99
1 changed files with 9 additions and 1 deletions
|
@ -334,7 +334,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
|
||||||
tracer.runctx('runtest(test, generate, verbose, quiet, testdir)',
|
tracer.runctx('runtest(test, generate, verbose, quiet, testdir)',
|
||||||
globals=globals(), locals=vars())
|
globals=globals(), locals=vars())
|
||||||
else:
|
else:
|
||||||
ok = runtest(test, generate, verbose, quiet, testdir, huntrleaks)
|
try:
|
||||||
|
ok = runtest(test, generate, verbose, quiet, testdir,
|
||||||
|
huntrleaks)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
# print a newline separate from the ^C
|
||||||
|
print
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
raise
|
||||||
if ok > 0:
|
if ok > 0:
|
||||||
good.append(test)
|
good.append(test)
|
||||||
elif ok == 0:
|
elif ok == 0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue