[Zodb-checkins] CVS: ZODB/src/ZODB/tests - StorageTestBase.py:1.31.2.1

Jeremy Hylton jeremy at zope.com
Fri Feb 13 11:32:36 EST 2004


Update of /cvs-repository/ZODB/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv15301

Modified Files:
      Tag: zope3-zodb3-devel-branch
	StorageTestBase.py 
Log Message:
partial fix for unpickling of direct references to classes


=== ZODB/src/ZODB/tests/StorageTestBase.py 1.31 => 1.31.2.1 ===
--- ZODB/src/ZODB/tests/StorageTestBase.py:1.31	Wed Dec 24 11:01:58 2003
+++ ZODB/src/ZODB/tests/StorageTestBase.py	Fri Feb 13 11:32:35 2004
@@ -79,19 +79,24 @@
     u.persistent_load = persistent_load
     klass_info = u.load()
     if isinstance(klass_info, types.TupleType):
-        if isinstance(klass_info[0], types.TupleType):
-            modname, klassname = klass_info[0]
+        if isinstance(klass_info[0], type):
+            # XXX what is the second part of klass_info?
+            klass, xxx = klass_info
+            assert not xxx
         else:
-            modname, klassname = klass_info
-        if modname == "__main__":
-            ns = globals()
-        else:
-            mod = import_helper(modname)
-            ns = mod.__dict__
-        try:
-            klass = ns[klassname]
-        except KeyError:
-            print >> sys.stderr, "can't find %s in %r" % (klassname, ns)
+            if isinstance(klass_info[0], tuple):
+                modname, klassname = klass_info[0]
+            else:
+                modname, klassname = klass_info
+            if modname == "__main__":
+                ns = globals()
+            else:
+                mod = import_helper(modname)
+                ns = mod.__dict__
+            try:
+                klass = ns[klassname]
+            except KeyError:
+                print >> sys.stderr, "can't find %s in %r" % (klassname, ns)
         inst = klass()
     else:
         raise ValueError, "expected class info: %s" % repr(klass_info)




More information about the Zodb-checkins mailing list