summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-09-10 18:08:22 -0400
committerChris McDonough <chrism@plope.com>2011-09-10 18:08:22 -0400
commit58bd32c7cdaff6d1b0e578e8a6887ea2f519866e (patch)
tree36693e32848c4061e3c3b1c7f1e4e7152f3e02e6
parent04c2fc5f264b03fcaeff8613df2967453c04b1a3 (diff)
downloadpyramid-58bd32c7cdaff6d1b0e578e8a6887ea2f519866e.tar.gz
pyramid-58bd32c7cdaff6d1b0e578e8a6887ea2f519866e.tar.bz2
pyramid-58bd32c7cdaff6d1b0e578e8a6887ea2f519866e.zip
futureproof by importing at function scope
-rw-r--r--pyramid/config/zca.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pyramid/config/zca.py b/pyramid/config/zca.py
index f27b2fb17..bcd5c31e3 100644
--- a/pyramid/config/zca.py
+++ b/pyramid/config/zca.py
@@ -1,5 +1,4 @@
from pyramid.threadlocal import get_current_registry
-from zope.component import getSiteManager
class ZCAConfiguratorMixin(object):
def hook_zca(self):
@@ -10,10 +9,12 @@ class ZCAConfiguratorMixin(object):
:func:`zope.component.getAdapter` and others to use the
:app:`Pyramid` :term:`application registry` rather than the Zope
'global' registry."""
+ from zope.component import getSiteManager
getSiteManager.sethook(get_current_registry)
def unhook_zca(self):
""" Call :func:`zope.component.getSiteManager.reset` to undo the
action of :meth:`pyramid.config.Configurator.hook_zca`."""
+ from zope.component import getSiteManager
getSiteManager.reset()