comparison 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
comparison
equal deleted inserted replaced
209:c03a8113685d 210:8c4e92fb32d8
107 pass 107 pass
108 # Do this even if we got no exceptions, just in case 108 # Do this even if we got no exceptions, just in case
109 say(file=sys.stderr) 109 say(file=sys.stderr)
110 sys.exit(1) 110 sys.exit(1)
111 111
112 if options.pause: 112 try:
113 say('Press any key to exit...') 113 if options.pause:
114 sys.stdout.flush() 114 say('Press any key to exit...')
115 115 sys.stdout.flush()
116 if pause: 116
117 pause() 117 if pause:
118 elif callable(globalconf.pause): 118 pause()
119 globalconf.pause() 119 elif callable(globalconf.pause):
120 else: 120 globalconf.pause()
121 with open(os.devnull, 'w') as devnull: 121 else:
122 subprocess.call(globalconf.pause, shell=True, stdout=devnull, stderr=subprocess.STDOUT) 122 with open(os.devnull, 'w') as devnull:
123 subprocess.call(globalconf.pause, shell=True, stdout=devnull, stderr=subprocess.STDOUT)
124 except KeyboardInterrupt:
125 pass