check if signal exists before placing it. It can absent in some OSes, like Windows

This commit is contained in:
Alexander Bersenev
2018-06-27 13:33:51 +05:00
parent 7eea7d3201
commit 71e3206b19

View File

@@ -66,12 +66,12 @@ except (ValueError, OSError):
except ImportError:
pass
if hasattr(signal, 'SIGUSR1'):
def debug_signal(signum, frame):
import pdb
pdb.set_trace()
def debug_signal(signum, frame):
import pdb
pdb.set_trace()
signal.signal(signal.SIGUSR1, debug_signal)
signal.signal(signal.SIGUSR1, debug_signal)
if len(sys.argv) > 1:
config = runpy.run_path(sys.argv[1])