summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-02-28 18:05:43 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-02-28 18:05:43 (GMT)
commit14ca327f998511da5e89f819204c54fa582dd696 (patch)
tree1654a56677160f054fa23863790c57f21c15e60e /Lib/test/regrtest.py
parenta829313d7b966caa1f6badce73873a1da4c2258c (diff)
downloadcpython-14ca327f998511da5e89f819204c54fa582dd696.zip
cpython-14ca327f998511da5e89f819204c54fa582dd696.tar.gz
cpython-14ca327f998511da5e89f819204c54fa582dd696.tar.bz2
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).
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 1734eba..e7601c8 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -334,7 +334,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
tracer.runctx('runtest(test, generate, verbose, quiet, testdir)',
globals=globals(), locals=vars())
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:
good.append(test)
elif ok == 0: