# HG changeset patch # User Oleg Oshmyan # Date 1306269212 -3600 # Node ID 517dd43f06f8fdc53894362ffead19c396c7250f # Parent f4361d55792951ef848e1b698799d83ca16ab488 Upreckon now properly reports exiting due to SIGINT to the calling process diff -r f4361d557929 -r 517dd43f06f8 upreckon-vcs --- a/upreckon-vcs Tue May 24 20:55:16 2011 +0100 +++ b/upreckon-vcs Tue May 24 21:33:32 2011 +0100 @@ -130,7 +130,16 @@ say() say('Grand total: %g/%g weighted points; %d/%d problems solved fully' % (realscore, maxscore, nfulltasks, ntasks)) except KeyboardInterrupt: - sys.exit('Exiting due to a keyboard interrupt.') + say('Exiting due to a keyboard interrupt.', end='', file=sys.stderr) + try: + import os, signal + signal.signal(signal.SIGINT, signal.SIG_DFL) + os.kill(os.getpid(), signal.SIGINT) + except Exception: + pass + # Do this even if we got no exceptions, just in case + say(file=sys.stderr) + sys.exit(1) if options.pause: say('Press any key to exit...')