# HG changeset patch # User Oleg Oshmyan # Date 1313625091 -10800 # Node ID 8c4e92fb32d8cd1bbcf111e01c6cc799c979f394 # Parent c03a8113685d558922796a9cf9f09856d48e139d Keyboard interrupts now satisfy the Press any key to exit... prompt diff -r c03a8113685d -r 8c4e92fb32d8 upreckon/_unixmodule.cpp --- a/upreckon/_unixmodule.cpp Thu Aug 18 02:41:46 2011 +0300 +++ b/upreckon/_unixmodule.cpp Thu Aug 18 02:51:31 2011 +0300 @@ -1276,7 +1276,13 @@ if (catch_escape) { char c; - while (read(0, &c, 1) == -1 && errno == EINTR); + while (read(0, &c, 1) == -1 && errno == EINTR) + { + if (PyErr_CheckSignals() == -1) + { + return NULL; + } + } } #endif Py_RETURN_NONE; diff -r c03a8113685d -r 8c4e92fb32d8 upreckon/upreckon-vcs --- a/upreckon/upreckon-vcs Thu Aug 18 02:41:46 2011 +0300 +++ b/upreckon/upreckon-vcs Thu Aug 18 02:51:31 2011 +0300 @@ -109,14 +109,17 @@ say(file=sys.stderr) sys.exit(1) -if options.pause: - say('Press any key to exit...') - sys.stdout.flush() - - if pause: - pause() - elif callable(globalconf.pause): - globalconf.pause() - else: - with open(os.devnull, 'w') as devnull: - subprocess.call(globalconf.pause, shell=True, stdout=devnull, stderr=subprocess.STDOUT) \ No newline at end of file +try: + if options.pause: + say('Press any key to exit...') + sys.stdout.flush() + + if pause: + pause() + elif callable(globalconf.pause): + globalconf.pause() + else: + with open(os.devnull, 'w') as devnull: + subprocess.call(globalconf.pause, shell=True, stdout=devnull, stderr=subprocess.STDOUT) +except KeyboardInterrupt: + pass