[Zodb-checkins] CVS: Zope/lib/python/ZODB - Connection.py:1.77

Jeremy Hylton jeremy@zope.com
Fri, 4 Oct 2002 16:44:28 -0400


Update of /cvs-repository/Zope/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv17395

Modified Files:
	Connection.py 
Log Message:
Initialize _begun to 0, not None.


=== Zope/lib/python/ZODB/Connection.py 1.76 => 1.77 ===
--- Zope/lib/python/ZODB/Connection.py:1.76	Mon Sep 16 19:50:39 2002
+++ Zope/lib/python/ZODB/Connection.py	Fri Oct  4 16:44:25 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!