From 7d8f44441f293c5d123f2145e2c7ff6692e87fa0 Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Mon, 27 Sep 2010 14:05:29 +0000
Subject: [PATCH] delay imports to avoid circular imports

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38667 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Dynamic/portaltypeclass.py | 2 +-
 product/ERP5Type/patches/getSite.py         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/Dynamic/portaltypeclass.py b/product/ERP5Type/Dynamic/portaltypeclass.py
index 0b5a8cf4dd..f48fc94df8 100644
--- a/product/ERP5Type/Dynamic/portaltypeclass.py
+++ b/product/ERP5Type/Dynamic/portaltypeclass.py
@@ -6,7 +6,7 @@ import sys
 import inspect
 from types import ModuleType
 
-from Products.ERP5Type.patches.getSite import getSite
+from zope.site.hooks import getSite
 from Products.ERP5Type.Globals import InitializeClass
 from Products.ERP5Type.Utils import setDefaultClassProperties
 
diff --git a/product/ERP5Type/patches/getSite.py b/product/ERP5Type/patches/getSite.py
index 64f1b1c2ce..3e433a0f74 100644
--- a/product/ERP5Type/patches/getSite.py
+++ b/product/ERP5Type/patches/getSite.py
@@ -1,4 +1,3 @@
-from Products.ERP5Type.Dynamic.portaltypeclass import synchronizeDynamicModules
 from Products.ERP5Type import Globals
 module_name = 'zope.site.hooks'
 try:
@@ -38,5 +37,6 @@ hooks.getSite = getSite
 last_cookie_value = None
 def setSite(site=None):
   _setSite(site)
+  from Products.ERP5Type.Dynamic.portaltypeclass import synchronizeDynamicModules
   synchronizeDynamicModules(site)
 hooks.setSite = setSite
-- 
2.30.9