From: Ian Jackson Date: Mon, 10 Apr 2017 00:45:03 +0000 (+0100) Subject: cope with jesse's signal module (which lacks sig.name) X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/commitdiff_plain/56afc4872ae3183df5bdaaea2c50089f6e3db19c cope with jesse's signal module (which lacks sig.name) Signed-off-by: Ian Jackson --- diff --git a/hippotatd b/hippotatd index bc55650..212e5c4 100755 --- a/hippotatd +++ b/hippotatd @@ -346,7 +346,9 @@ def catch_termination(): raise RuntimeError('did not die due to signal %s !' % name) for sig in (signal.SIGINT, signal.SIGTERM): - signal.signal(sig, partial(signal_handler, sig.name)) + try: signame = sig.name + except AttributeError: signame = "signal %d" % sig + signal.signal(sig, partial(signal_handler, signame)) def daemonise(): global syslogfacility