[Zodb-checkins] CVS: Zope3/src/ZODB - DB.py:1.63

Jim Fulton jim at zope.com
Wed Feb 25 07:31:57 EST 2004


Update of /cvs-repository/Zope3/src/ZODB
In directory cvs.zope.org:/tmp/cvs-serv5009/src/ZODB

Modified Files:
	DB.py 
Log Message:
Changed the default class factory to support broken objects.

Broken objects are objects who's class has gone away, typically
because modules or classes have been removed or moved.


=== Zope3/src/ZODB/DB.py 1.62 => 1.63 ===
--- Zope3/src/ZODB/DB.py:1.62	Thu Feb 19 14:10:59 2004
+++ Zope3/src/ZODB/DB.py	Wed Feb 25 07:31:56 2004
@@ -23,6 +23,7 @@
 from serialize import referencesf
 from time import time, ctime
 from zLOG import LOG, ERROR
+from ZODB.broken import find_global
 
 from types import StringType
 
@@ -122,10 +123,8 @@
         else: m=None
         return m
 
-    def _classFactory(self, connection, location, name,
-                      _silly=('__doc__',), _globals={}):
-        return getattr(__import__(location, _globals, _globals, _silly),
-                       name)
+    def _classFactory(self, connection, modulename, globalname):
+        return find_global(modulename, globalname)
 
     def _closeConnection(self, connection):
         """Return a connection to the pool"""




More information about the Zodb-checkins mailing list