Move the SetCtrlHandler call before the firing of the event.

This commit is contained in:
Griatch 2016-11-25 09:07:09 +01:00
parent 870b417855
commit 3a4a097163

View file

@ -719,8 +719,8 @@ def kill(pidfile, signal=SIG, succmsg="", errmsg="",
# Windows can only send a SIGINT-like signal to
# *every* process spawned off the same console, so we must
# avoid killing ourselves here.
GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0)
SetConsoleCtrlHandler(None, True)
GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0)
except KeyboardInterrupt:
pass
else: