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