Louie Lu added the comment: Based on Martin's patch, I slightly changed the logic for the patch.
So, I add a `finish` flag to detect the code in Executive.runcode is done or not. `interrupt_the_server` will first SIGINT via interrupt_main, if this doesn't work after 0.2 seconds, it will then sent the signal by pthread_kill to main_thread. This will work on Linux, and MacOS which I tested. And it will avoid the different behavior for `input()` (which I believe is because of the GNU readline been used.) and `time.sleep()` in only using `interrupt_main` or `signal.pthread_kill`. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29926> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com