Index: Lib/test/regrtest.py =================================================================== --- Lib/test/regrtest.py (revision 79494) +++ Lib/test/regrtest.py (working copy) @@ -373,6 +373,7 @@ skipped = [] resource_denieds = [] environment_changed = [] + interrupted = False if findleaks: try: @@ -539,6 +540,7 @@ raise KeyboardInterrupt # What else? accumulate_result(test, result) except KeyboardInterrupt: + interrupted = True pending.close() for worker in workers: worker.join() @@ -561,6 +563,7 @@ print "Re-running test %r in verbose mode" % test runtest(test, True, quiet, testdir, huntrleaks) except KeyboardInterrupt: + interrupted = True # print a newline separate from the ^C print break @@ -580,6 +583,8 @@ if module not in save_modules and module.startswith("test."): test_support.unload(module) + if interrupted: + print "Test suite interrupted by signal SIGINT." if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", @@ -646,7 +651,7 @@ if runleaks: os.system("leaks %d" % os.getpid()) - sys.exit(len(bad) > 0) + sys.exit(len(bad) > 0 or interrupted) STDTESTS = [