summaryrefslogtreecommitdiff
path: root/cherrypy/_cptools.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-12-17 00:52:58 -0500
committerJason R. Coombs <jaraco@jaraco.com>2017-12-17 00:52:58 -0500
commit52682a78ee9c471bcb5f0f02cde69b63202b02de (patch)
treec4cf97ed5052032833ae8bcf9b07f637ff7aa9f3 /cherrypy/_cptools.py
parent9a143b81c9b0a13274e8abb05445276f7189bfb5 (diff)
downloadcherrypy-git-use-projection.tar.gz
Demonstrate how a Projection might be a nice way to assign some parameters.use-projection
Diffstat (limited to 'cherrypy/_cptools.py')
-rw-r--r--cherrypy/_cptools.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/cherrypy/_cptools.py b/cherrypy/_cptools.py
index 92c2b656..e51a963c 100644
--- a/cherrypy/_cptools.py
+++ b/cherrypy/_cptools.py
@@ -25,6 +25,8 @@ are generally either modules or instances of the tools.Tool class.
import sys
import warnings
+from jaraco.collections import Projection
+
import cherrypy
from cherrypy._helper import expose
@@ -323,11 +325,7 @@ class SessionTool(Tool):
# Grab cookie-relevant tool args
relevant = 'path', 'path_header', 'name', 'timeout', 'domain', 'secure'
- conf = dict(
- (k, v)
- for k, v in self._merged_args().items()
- if k in relevant
- )
+ conf = Projection(relevant, self._merged_args())
_sessions.set_response_cookie(**conf)