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

Jeremy Hylton jeremy at zope.com
Wed Dec 31 11:27:30 EST 2003


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

Modified Files:
	Connection.py 
Log Message:
Split assert into two parts, checking for None in second part.

The comment indicated that end could be None, and I've fleshed out the
comment with more detail.


=== ZODB3/ZODB/Connection.py 1.106 => 1.107 ===
--- ZODB3/ZODB/Connection.py:1.106	Sat Dec 27 08:54:04 2003
+++ ZODB3/ZODB/Connection.py	Wed Dec 31 11:27:29 2003
@@ -20,7 +20,7 @@
 import threading
 from time import time
 from types import ClassType
-from utils import U64
+from utils import u64
 
 _marker = object()
 
@@ -518,10 +518,13 @@
         # txn_time.  It must be current at txn_time, but could have
         # been modified at txn_time.
 
-        # It's possible that end is None, if, e.g., the most recent
-        # invalidation was for version data.
-        assert start < self._txn_time <= end, \
-               (U64(start), U64(self._txn_time), U64(end))
+        # It's possible that end is None.  The _txn_time is set by an
+        # invalidation for one specific object, but it used for the
+        # load time for all objects.  If an object hasn't been
+        # modified since _txn_time, it's end tid will be None.
+        assert start < self._txn_time, (u64(start), u64(self._txn_time))
+        assert end is None or self._txn_time <= end, \
+               (u64(self._txn_time), u64(end))
         self._noncurrent[obj._p_oid] = True
         self._reader.setGhostState(obj, data)
         obj._p_serial = start




More information about the Zodb-checkins mailing list