# HG changeset patch # User Paul Boddie # Date 1309816202 -7200 # Node ID d88f693525282702d3e14cd442fc57650867204d # Parent cf329206154e53f92e60057451a3f84a17223f1f Introduced keyboard interrupt handling. diff -r cf329206154e -r d88f69352528 test.py --- a/test.py Sun Jul 03 22:51:51 2011 +0200 +++ b/test.py Mon Jul 04 23:50:02 2011 +0200 @@ -113,4 +113,10 @@ elif "-exit" in args: sys.exit(1) + except KeyboardInterrupt: + if "-exit" in args: + sys.exit(2) + else: + raise + # vim: tabstop=4 expandtab shiftwidth=4 diff -r cf329206154e -r d88f69352528 test_all.py --- a/test_all.py Sun Jul 03 22:51:51 2011 +0200 +++ b/test_all.py Mon Jul 04 23:50:02 2011 +0200 @@ -38,7 +38,12 @@ for filename in filenames: print "Processing", filename - success = 0 == os.system("%s test.py %s %s" % (sys.executable, filename, " ".join(args))) + status = os.system("%s test.py %s %s" % (sys.executable, filename, " ".join(args))) + if status == 2: + print "Interrupted!" + break + + success = status == 0 print "Test successful?", success and "Yes" or "No" results.append((filename, success))