summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2017-04-02 12:50:48 -0500
committerMichael Merickel <michael@merickel.org>2017-04-02 12:50:48 -0500
commitf5ff7e0dd3a5b8bc1fd6978e361c9ab8391b6960 (patch)
tree15d642d38153ced2d5cf72273111ce5d74abeed2
parenta857ebbc65c0491f27d39c7a6c1ba485c99fee5d (diff)
downloadpyramid-f5ff7e0dd3a5b8bc1fd6978e361c9ab8391b6960.tar.gz
pyramid-f5ff7e0dd3a5b8bc1fd6978e361c9ab8391b6960.tar.bz2
pyramid-f5ff7e0dd3a5b8bc1fd6978e361c9ab8391b6960.zip
push the threadlocal registry while config.include executes
-rw-r--r--pyramid/config/__init__.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pyramid/config/__init__.py b/pyramid/config/__init__.py
index 304d3a85e..6c661aa59 100644
--- a/pyramid/config/__init__.py
+++ b/pyramid/config/__init__.py
@@ -753,6 +753,11 @@ class Configurator(
.. versionadded:: 1.2
The ``route_prefix`` parameter.
+ .. versionchanged:: 1.9
+ The included function is wrapped with a call to
+ :meth:`pyramid.config.Configurator.begin` and
+ :meth:`pyramid.config.Configurator.end` while it is executed.
+
"""
# """ <-- emacs
@@ -802,7 +807,11 @@ class Configurator(
)
configurator.basepath = os.path.dirname(sourcefile)
configurator.includepath = self.includepath + (spec,)
- c(configurator)
+ self.begin()
+ try:
+ c(configurator)
+ finally:
+ self.end()
def add_directive(self, name, directive, action_wrap=True):
"""