summaryrefslogtreecommitdiff
path: root/cherrypy/process/plugins.py
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2008-06-30 19:11:18 +0000
committerRobert Brewer <fumanchu@aminus.org>2008-06-30 19:11:18 +0000
commit8b44fb481851f53483ac76a7d158bb06fcdaa037 (patch)
tree60b19d6e52f1b37631ea61db962bcc914aba19a0 /cherrypy/process/plugins.py
parentee771633cbc46b7b2e08d815b4278287401ff1f8 (diff)
downloadcherrypy-git-8b44fb481851f53483ac76a7d158bb06fcdaa037.tar.gz
SignalHandler.unsubscribe now warns if our handler is not returned. See #826.
Diffstat (limited to 'cherrypy/process/plugins.py')
-rw-r--r--cherrypy/process/plugins.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cherrypy/process/plugins.py b/cherrypy/process/plugins.py
index ca3ab836..7f3cde7e 100644
--- a/cherrypy/process/plugins.py
+++ b/cherrypy/process/plugins.py
@@ -80,10 +80,14 @@ class SignalHandler(object):
self.bus.log("Restoring %s handler %r." % (signame, handler))
try:
- _signal.signal(signum, handler)
+ our_handler = _signal.signal(signum, handler)
+ if our_handler is None:
+ self.bus.log("Restored old %s handler %r, but our "
+ "handler was not registered." %
+ (signame, handler), level=30)
except ValueError:
self.bus.log("Unable to restore %s handler %r." %
- (signame, handler), traceback=True)
+ (signame, handler), level=40, traceback=True)
def set_handler(self, signal, listener=None):
"""Subscribe a handler for the given signal (number or name).