forked from p15670423/monkey
Agent: Check _signal_handler before resetting on Windows
We don't need to call win32api.SetConsoleCtrlHandler if _signal_handler is None (i.e. was never set).
This commit is contained in:
parent
a2ac2658ed
commit
cda113d291
|
@ -71,7 +71,8 @@ def reset_signal_handlers():
|
||||||
if is_windows_os():
|
if is_windows_os():
|
||||||
import win32api
|
import win32api
|
||||||
|
|
||||||
win32api.SetConsoleCtrlHandler(_signal_handler, False)
|
if _signal_handler:
|
||||||
|
win32api.SetConsoleCtrlHandler(_signal_handler, False)
|
||||||
else:
|
else:
|
||||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||||
signal.signal(signal.SIGTERM, signal.SIG_DFL)
|
signal.signal(signal.SIGTERM, signal.SIG_DFL)
|
||||||
|
|
Loading…
Reference in New Issue