[Zodb-checkins] CVS: ZODB3/ZODB/tests - StorageTestBase.py:1.24

Barry Warsaw barry@wooz.org
Wed, 22 Jan 2003 11:58:42 -0500


Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv21979

Modified Files:
	StorageTestBase.py 
Log Message:
zodb_pickle(): Use a lambda for convenience.


=== ZODB3/ZODB/tests/StorageTestBase.py 1.23 => 1.24 ===
--- ZODB3/ZODB/tests/StorageTestBase.py:1.23	Tue Jan 21 16:54:29 2003
+++ ZODB3/ZODB/tests/StorageTestBase.py	Wed Jan 22 11:58:39 2003
@@ -37,12 +37,9 @@
 
 def zodb_pickle(obj):
     """Create a pickle in the format expected by ZODB."""
-    def persistent_id(obj):
-        return getattr(obj, '_p_oid', None)
-
     f = StringIO()
     p = Pickler(f, 1)
-    p.persistent_id = persistent_id
+    p.persistent_id = lambda obj: getattr(obj, '_p_oid', None)
     klass = obj.__class__
     assert not hasattr(obj, '__getinitargs__'), "not ready for constructors"
     args = None