Commit 0a860acc authored by Arnaud Fontaine's avatar Arnaud Fontaine

py3: sortKey() must be a string as comparison between str and None/int/tuple now raises TypeError.

And Zope4 now mandates it to be a string ({Shared.DC.ZRDB.TM.TM,ITransactionManager}.sortKey()).
parent b230c4e3
......@@ -75,4 +75,4 @@ class ActivityBuffer(TM):
def sortKey(self, *ignored):
"""Activities must be finished before databases commit transactions."""
return -1
return '-1'
......@@ -34,7 +34,7 @@ from Acquisition import aq_parent
# If the sort order below doesn't work, we cannot guarantee the sort key
# used below will actually result in the activity connection being committed
# after the ZODB and Catalog data.
assert None < 0 < '' < (), "Cannot guarantee commit of activities comes after the appropriate data"
assert '\x00' < '-1' < '0' < '1' < '\xff', "Cannot guarantee commit of activities comes after the appropriate data"
manage_addActivityConnectionForm = HTMLFile('dtml/connectionAdd', globals())
......@@ -66,4 +66,4 @@ InitializeClass(ActivityConnection)
class ActivityDB(DB):
_sort_key = (0,)
_sort_key = '\xff'
......@@ -70,7 +70,7 @@ class TransactionalVariable(dict):
_unregistered = True
def sortKey(self):
return None
return '\x00'
commit = tpc_vote = tpc_begin = tpc_abort = lambda self, transaction: None
......@@ -128,7 +128,7 @@ class TransactionalResource(object):
return not (args in tv or tv.add(args))
def sortKey(self):
return 1
return '1'
abort = commit = tpc_vote = tpc_begin = tpc_finish = tpc_abort = \
lambda self, transaction: None
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