summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-08-17 13:15:22 -0400
committerJason R. Coombs <jaraco@jaraco.com>2018-08-17 13:15:22 -0400
commitcb81bf9bdd46b65afbe70ef5efcbb63a408b661f (patch)
treef411a585fe47ce2dec09fcba46d89c0c213e98c6
parent70adb8def132f2b8cd53d1782dac8e37746381de (diff)
downloadcherrypy-git-cb81bf9bdd46b65afbe70ef5efcbb63a408b661f.tar.gz
Handle SIGHUP and SIGTERM in one go
-rw-r--r--cherrypy/_cpconfig.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cherrypy/_cpconfig.py b/cherrypy/_cpconfig.py
index 0c8ed6ce..a003ce69 100644
--- a/cherrypy/_cpconfig.py
+++ b/cherrypy/_cpconfig.py
@@ -263,11 +263,11 @@ def _engine_namespace_handler(k, v):
"""Config handler for the "engine" namespace."""
engine = cherrypy.engine
- if k == 'SIGHUP':
- engine.subscribe('SIGHUP', v)
- elif k == 'SIGTERM':
- engine.subscribe('SIGTERM', v)
- elif '.' in k:
+ if k in {'SIGHUP', 'SIGTERM'}:
+ engine.subscribe(k, v)
+ return
+
+ if '.' in k:
plugin, attrname = k.split('.', 1)
plugin = getattr(engine, plugin)
op = 'subscribe' if v else 'unsubscribe'