summaryrefslogtreecommitdiff
path: root/paste/deploy/config.py
diff options
context:
space:
mode:
authorpjenvey <devnull@localhost>2006-12-21 21:57:56 +0000
committerpjenvey <devnull@localhost>2006-12-21 21:57:56 +0000
commit9ba008b7c87d3db7e83d17542e153554075fa083 (patch)
tree02b9d905c266b378bbe6abaa50bbf489ce779bc0 /paste/deploy/config.py
parent4ad502f1d069d7f6b8bb720959b78bf1d8e273c6 (diff)
downloadpastedeploy-9ba008b7c87d3db7e83d17542e153554075fa083.tar.gz
restore the popped paste.config to environ when appropriate
Diffstat (limited to 'paste/deploy/config.py')
-rw-r--r--paste/deploy/config.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/paste/deploy/config.py b/paste/deploy/config.py
index bf271a3..dd81195 100644
--- a/paste/deploy/config.py
+++ b/paste/deploy/config.py
@@ -154,6 +154,9 @@ class ConfigMiddleware(object):
import pkg_resources
pkg_resources.require('Paste')
from paste import wsgilib
+ popped_config = None
+ if 'paste.config' in environ:
+ popped_config = environ['paste.config']
conf = environ['paste.config'] = self.config.copy()
app_iter = None
CONFIG.push_thread_config(conf)
@@ -163,11 +166,15 @@ class ConfigMiddleware(object):
if app_iter is None:
# An error occurred...
CONFIG.pop_thread_config(conf)
+ if popped_config is not None:
+ environ['paste.config'] = popped_config
if type(app_iter) in (list, tuple):
# Because it is a concrete iterator (not a generator) we
# know the configuration for this thread is no longer
# needed:
CONFIG.pop_thread_config(conf)
+ if popped_config is not None:
+ environ['paste.config'] = popped_config
return app_iter
else:
def close_config():