[Zodb-checkins] CVS: Zope2/lib/python/ZODB - VersionStorage.py:1.4
barry@digicool.com
barry@digicool.com
Thu, 19 Apr 2001 16:50:43 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/ZODB/tests
In directory korak:/tmp/cvs-serv30473
Modified Files:
VersionStorage.py
Log Message:
Use cPickle if available
--- Updated File VersionStorage.py in package Zope2/lib/python/ZODB --
--- VersionStorage.py 2001/04/12 23:32:38 1.3
+++ VersionStorage.py 2001/04/19 20:50:43 1.4
@@ -1,7 +1,13 @@
# Run the version related tests for a storage. Any storage that supports
# versions should be able to pass all these tests.
-import pickle
+try:
+ import cPickle
+ pickle = cPickle
+ #import cPickle as pickle
+except ImportError:
+ import pickle
+
from ZODB import POSException
@@ -271,7 +277,6 @@
assert pickle.loads(data) == 54
data, revid = self._storage.load(oid2, '')
assert pickle.loads(data) == 54
-
#JF# To do a test like you want, you have to add the data in a version
oid = self._storage.new_oid()