[Zope-Checkins] CVS: ZODB3/ZODB - transact.py:1.2

Jeremy Hylton jeremy@zope.com
Wed, 11 Jun 2003 11:05:07 -0400


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv2606

Modified Files:
	transact.py 
Log Message:
Fix bug in last-minute revision:  Can't rebind retries in g().


=== ZODB3/ZODB/transact.py 1.1 => 1.2 ===
--- ZODB3/ZODB/transact.py:1.1	Wed Jun 11 10:58:29 2003
+++ ZODB3/ZODB/transact.py	Wed Jun 11 11:05:07 2003
@@ -36,20 +36,21 @@
     # 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