From b7ede15b06c231f7c8a734dbc0154a30abe6cc0b Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 7 Nov 2016 23:10:31 +0100 Subject: [PATCH] Print message before shutdown --- src/Debug/DebugHook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Debug/DebugHook.py b/src/Debug/DebugHook.py index 7c2ba510..a95d9719 100644 --- a/src/Debug/DebugHook.py +++ b/src/Debug/DebugHook.py @@ -9,6 +9,7 @@ from Config import config last_error = None def shutdown(): + print "Shutting down..." try: if "file_server" in dir(sys.modules["main"]): gevent.spawn(sys.modules["main"].file_server.stop) @@ -30,6 +31,7 @@ def handleError(*args): last_error = args if args[0].__name__ == "KeyboardInterrupt": shutdown() + return if not silent and args[0].__name__ != "Notify": logging.exception("Unhandled exception") sys.__excepthook__(*args) @@ -91,4 +93,4 @@ if __name__ == "__main__": thread1.kill(exception=Debug.Notify("Worker stopped")) #thread2.throw(Debug.Notify("Throw")) print "killed" - gevent.joinall([thread1,thread2]) + gevent.joinall([thread1,thread2]) \ No newline at end of file