[Erp5-report] r39389 yo - /erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 20 13:30:01 CEST 2010


Author: yo
Date: Wed Oct 20 13:29:56 2010
New Revision: 39389

URL: http://svn.erp5.org?rev=39389&view=rev
Log:
Do not use _import_class but use __import__ directly, because class initialization is not required for the bootstrap problem.

Modified:
    erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py

Modified: erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py?rev=39389&r1=39388&r2=39389&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py [utf8] Wed Oct 20 13:29:56 2010
@@ -148,7 +148,10 @@ def portal_type_factory(portal_type_name
       # XXX heuristic: bootstrap issues should happen only inside ERP5Type.
       if not path.startswith('Products.ERP5Type.'):
         continue
-      klass = _import_class(path)
+
+      module_path, class_name = path.rsplit('.', 1)
+      module = __import__(module_path, {}, {}, (module_path,))
+      klass = getattr(module, class_name)
       try:
         try:
           document_portal_type = getattr(klass, 'portal_type')




More information about the Erp5-report mailing list