summaryrefslogtreecommitdiff
path: root/cherrypy/process/plugins.py
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2008-06-29 18:20:51 +0000
committerRobert Brewer <fumanchu@aminus.org>2008-06-29 18:20:51 +0000
commit449ff9b34770e47a52079e36aaca29c08fa53c6c (patch)
treea40ea993c58d8ea2e057d3d3b181f42df02ab58e /cherrypy/process/plugins.py
parent9f963a79cdc7586f0423411584b09859a9e17d42 (diff)
downloadcherrypy-git-449ff9b34770e47a52079e36aaca29c08fa53c6c.tar.gz
Fixed sig handler unsubscribe test for Unix, plus an odd race condition in autoreload.
Diffstat (limited to 'cherrypy/process/plugins.py')
-rw-r--r--cherrypy/process/plugins.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cherrypy/process/plugins.py b/cherrypy/process/plugins.py
index 29f63342..ca3ab836 100644
--- a/cherrypy/process/plugins.py
+++ b/cherrypy/process/plugins.py
@@ -70,8 +70,8 @@ class SignalHandler(object):
pass
def unsubscribe(self):
- for sig, handler in self._previous_handlers.iteritems():
- signame = self.signals[sig]
+ for signum, handler in self._previous_handlers.iteritems():
+ signame = self.signals[signum]
if handler is None:
self.bus.log("Restoring %s handler to SIG_DFL." % signame)
@@ -80,10 +80,10 @@ class SignalHandler(object):
self.bus.log("Restoring %s handler %r." % (signame, handler))
try:
- _signal.signal(sig, handler)
+ _signal.signal(signum, handler)
except ValueError:
self.bus.log("Unable to restore %s handler %r." %
- (signame, handler))
+ (signame, handler), traceback=True)
def set_handler(self, signal, listener=None):
"""Subscribe a handler for the given signal (number or name).
@@ -397,9 +397,10 @@ class Monitor(SimplePlugin):
self.bus.log("No thread running for %s." % self.__class__.__name__)
else:
if self.thread is not threading.currentThread():
+ name = self.thread.getName()
self.thread.cancel()
self.thread.join()
- self.bus.log("Stopped thread %r." % self.thread.getName())
+ self.bus.log("Stopped thread %r." % name)
self.thread = None
def graceful(self):