chiark / gitweb /
cope with jesse's signal module (which lacks sig.name)
[hippotat.git] / hippotatd
index bc556507a63ceccb7da2c09fd74374381bac100c..212e5c4137e2874e75045f57e30f62a5e2de21c4 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