Commit 4d149fb5 authored by Jeremy Hylton's avatar Jeremy Hylton

Fix bug in last-minute revision: Can't rebind retries in g().

parent b7378d61
......@@ -36,20 +36,21 @@ def transact(f, note=None, retries=5):
# XXX deal with ZEO disconnected errors?
def g(*args, **kwargs):
while retries:
retries -= 1
n = retries
while n:
n -= 1
try:
r = f(*args, **kwargs)
except ReadConflictError, msg:
get_transaction().abort()
if not retries:
if not n:
raise
continue
try:
_commit(note)
except ConflictError, msg:
get_transaction().abort()
if not retries:
if not n:
raise
continue
return r
......
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