fix signal handling error on windows
This commit is contained in:
parent
09a67904b1
commit
529cf2464f
@ -106,8 +106,11 @@ def signal_handler(sig, frame):
|
||||
|
||||
|
||||
def main():
|
||||
signal.signal(signal.SIGTSTP, signal.SIG_IGN) # ignore CTRL+Z
|
||||
signal.signal(signal.SIGINT, signal_handler) # custom CTRL+C handler
|
||||
try:
|
||||
signal.signal(signal.SIGTSTP, signal.SIG_IGN) # ignore CTRL+Z
|
||||
signal.signal(signal.SIGINT, signal_handler) # custom CTRL+C handler
|
||||
except AttributeError: # not all signals are supported on all platforms
|
||||
pass
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
usage()
|
||||
|
Loading…
x
Reference in New Issue
Block a user