Open sloonz opened 3 years ago
I can reproduce this. Any ideas on how to handle this?
Relevant issue: https://stackoverflow.com/a/14708549/3455614
The only workaround I've found is calling dispatch in a thread:
if __name__ == '__main__':
Thread(target=main).start()
while True:
try:
time.sleep(1)
except KeyboardInterrupt:
os.kill(os.getpid(), 9)
This simple script ignores SIGINT (Control-C in a terminal). Adding
signal.signal(signal.SIGUSR1, lambda *a: print("USR1"))
shows that it ignores all signals.The comparable C program does not display this behavior and can be stopped by pressing Control-C :