Simon Arlott added the comment:
Another way to do this is to call threading.main_thread().join() in another
thread and do the shutdown cleanup when it returns.
The main thread is stopped at shutdown just before the
threading._threading_atexits are called.
--
nosy: +sa
Simon Arlott added the comment:
Access to rl_reset_line_state (and possibly others in the Redisplay
section) are also required, otherwise it's not possible to recover from
KeyboardInterrupt during raw_input() if readline isn't in the expected
editing mode.
Example:
1. call raw_i