Browse Source

Capture SIGINT Ctrl+C for a clean server exit through atexit

master
Nils 4 years ago
parent
commit
a2cafbb1af
  1. 7
      engine/start.py

7
engine/start.py

@ -229,6 +229,13 @@ except:
pass
#Capture Ctlr+C / SIGINT and let @atexit handle the rest.
import signal
import sys
def signal_handler(sig, frame):
sys.exit(0) #atexit will trigger
signal.signal(signal.SIGINT, signal_handler)
#Catch Exceptions even if PyQt crashes.
import sys
sys._excepthook = sys.excepthook

Loading…
Cancel
Save