Mercurial > ~astiob > upreckon > hgweb
diff upreckon/upreckon-vcs @ 210:8c4e92fb32d8
Keyboard interrupts now satisfy the Press any key to exit... prompt
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Thu, 18 Aug 2011 02:51:31 +0300 |
parents | d46bb4495766 |
children | 78be952f6b40 |
line wrap: on
line diff
--- 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