def interrupt_main():
if _main:<EOL><INDENT>raise KeyboardInterrupt<EOL><DEDENT>else:<EOL><INDENT>global _interrupt<EOL>_interrupt = True<EOL><DEDENT>
Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting.