diff options
| author | Neal Norwitz <nnorwitz@gmail.com> | 2006-02-28 18:05:43 +0000 | 
|---|---|---|
| committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-02-28 18:05:43 +0000 | 
| commit | 14ca327f998511da5e89f819204c54fa582dd696 (patch) | |
| tree | 1654a56677160f054fa23863790c57f21c15e60e /Lib | |
| parent | a829313d7b966caa1f6badce73873a1da4c2258c (diff) | |
| download | cpython-git-14ca327f998511da5e89f819204c54fa582dd696.tar.gz | |
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')
| -rwxr-xr-x | Lib/test/regrtest.py | 10 | 
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 1734eba4b2..e7601c8781 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:  | 
