Skip to content

Commit

Permalink
Fix handle_all_serials for the new and old protocols.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jul 9, 2016
1 parent e068c31 commit f5f670c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ZODB/tests/StorageTestBase.py
Expand Up @@ -113,16 +113,24 @@ def handle_all_serials(oid, *args):
The original interface just returned the serialno for the
object.
The updated multi-commit API returns nothing from store(), and
returns a sequence of resolved oids from tpc_vote.
"""
d = {}
for arg in args:
if isinstance(arg, bytes):
d[oid] = arg
elif arg:
for oid, serial in arg:
if not isinstance(serial, bytes):
raise serial # error from ZEO server
d[oid] = serial
for t in arg:
if isinstance(t, bytes):
# This will be the tid returned by tpc_finish.
pass
else:
oid, serial = t
if not isinstance(serial, bytes):
raise serial # error from ZEO server
d[oid] = serial
return d

def handle_serials(oid, *args):
Expand Down

0 comments on commit f5f670c

Please sign in to comment.