Commit e080bdcc authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #86 from NextThought/handle-serials4

Fix handle_all_serials for the new and old protocols.
parents 45831d69 c13649da
...@@ -113,15 +113,25 @@ def handle_all_serials(oid, *args): ...@@ -113,15 +113,25 @@ def handle_all_serials(oid, *args):
The original interface just returned the serialno for the The original interface just returned the serialno for the
object. object.
The updated multi-commit API returns nothing from store(), and
returns a sequence of resolved oids from tpc_vote.
NOTE: This function is removed entirely in ZODB 5.
""" """
d = {} d = {}
for arg in args: for arg in args:
if isinstance(arg, bytes): if isinstance(arg, bytes):
d[oid] = arg d[oid] = arg
elif arg is None: elif arg:
for t in arg:
if isinstance(t, bytes):
# New protocol. The caller will use the tid
# returned from tpc_finish if we return a dict
# missing the oid.
pass pass
else: else:
for oid, serial in arg: oid, serial = t
if not isinstance(serial, bytes): if not isinstance(serial, bytes):
raise serial # error from ZEO server raise serial # error from ZEO server
d[oid] = serial d[oid] = serial
......
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