chiark / gitweb /
cope with jesse's signal module (which lacks sig.name)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Apr 2017 00:45:03 +0000 (01:45 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Apr 2017 00:45:03 +0000 (01:45 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hippotatd

index bc55650..212e5c4 100755 (executable)
--- 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