Message314669
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. |
|
Date |
User |
Action |
Args |
2018-03-29 20:05:00 | Patrick Fink | set | recipients:
+ Patrick Fink, tim.peters, georg.brandl, terry.reedy, pitrou, amcnabb, vstinner, Devin Jeanpierre, pts, s7v7nislands, neologix, Netto |
2018-03-29 20:05:00 | Patrick Fink | set | messageid: <1522353900.03.0.467229070634.issue5315@psf.upfronthosting.co.za> |
2018-03-29 20:05:00 | Patrick Fink | link | issue5315 messages |
2018-03-29 20:04:59 | Patrick Fink | create | |
|