Commit 0b562a83 authored by Julien Muchembled's avatar Julien Muchembled

Partial support for more recent versions of ZODB

parent 6920866f
......@@ -16,8 +16,6 @@ from ZODB import DemoStorage as _DemoStorage
from ZODB.ConflictResolution import ConflictResolvingStorage, ResolvedSerial
from ZODB.POSException import ConflictError
assert not issubclass(_DemoStorage.DemoStorage, ConflictResolvingStorage)
class DemoStorage(_DemoStorage.DemoStorage, ConflictResolvingStorage):
##
# Implement conflict resolution for DemoStorage
......@@ -33,4 +31,6 @@ class DemoStorage(_DemoStorage.DemoStorage, ConflictResolvingStorage):
self.changes.store(oid, old, rdata, '', transaction)
return ResolvedSerial
_DemoStorage.DemoStorage = DemoStorage
if not issubclass(_DemoStorage.DemoStorage, ConflictResolvingStorage):
# BBB: ZODB < 4.3
_DemoStorage.DemoStorage = DemoStorage
......@@ -59,7 +59,11 @@ class OrderedPickler(Pickler):
dispatch[PyStringMap] = save_dict
def reorderPickle(jar, p):
from ZODB.ExportImport import Ghost, Unpickler, Pickler, StringIO, persistent_id
try:
from ZODB._compat import Unpickler, Pickler
except ImportError: # BBB: ZODB 3.10
from ZODB.ExportImport import Unpickler, Pickler
from ZODB.ExportImport import Ghost, persistent_id
oids = {}
storage = jar._storage
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment