From 58bd32c7cdaff6d1b0e578e8a6887ea2f519866e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 10 Sep 2011 18:08:22 -0400 Subject: futureproof by importing at function scope --- pyramid/config/zca.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3