Patrick Fink <m...@pfink.de> added the comment: A workaround to handle signals reliably that I successfully tested now is to execute everything within a subthread and let the main thread just join this subthread. Like:
signal.signal(MY_SIGNAL, signal_handler) threading.Thread(target = my_main_function) thread.start() thread.join() Doing it like this, the main thread should always listen to signals disregarding whether the subthread is stuck. ---------- nosy: +Patrick Fink _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue5315> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com