[Zodb-checkins] CVS: ZODB3/ZODB - Connection.py:1.76.4.1

Guido van Rossum guido@python.org
Fri, 4 Oct 2002 20:28:14 -0400


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

Modified Files:
      Tag: ZODB3-3_1-branch
	Connection.py 
Log Message:
Merge changes from trunk to release branch.

=== ZODB3/ZODB/Connection.py 1.76 => 1.76.4.1 ===
--- ZODB3/ZODB/Connection.py:1.76	Mon Sep 16 19:50:39 2002
+++ ZODB3/ZODB/Connection.py	Fri Oct  4 20:28:13 2002
@@ -270,7 +270,7 @@
 
     # NB: commit() is responsible for calling tpc_begin() on the storage.
     # It uses self._begun to track whether it has been called.  When
-    # self._begun is None, it has not been called.
+    # self._begun is 0, it has not been called.
 
     # This arrangement allows us to handle the special case of a
     # transaction with no modified objects.  It is possible for
@@ -285,7 +285,7 @@
 
     def commit(self, object, transaction):
         if object is self:
-            if self._begun is None:
+            if not self._begun:
                 self._storage.tpc_begin(transaction)
                 self._begun = 1
 
@@ -313,7 +313,7 @@
             # Nothing to do
             return
 
-        if self._begun is None:
+        if not self._begun:
             self._storage.tpc_begin(transaction)
             self._begun = 1
 
@@ -623,7 +623,7 @@
     def tpc_begin(self, transaction, sub=None):
         self._invalidating = []
         self._creating = []
-        self._begun = None
+        self._begun = 0
 
         if sub:
             # Sub-transaction!