[Zope-Checkins] CVS: ZODB3/ZODB - Connection.py:1.108

Jeremy Hylton jeremy at zope.com
Fri Jan 2 14:57:13 EST 2004


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

Modified Files:
	Connection.py 
Log Message:
Reformat sync() and exchange().  Change exchange() comment.


=== ZODB3/ZODB/Connection.py 1.107 => 1.108 ===
--- ZODB3/ZODB/Connection.py:1.107	Wed Dec 31 11:27:29 2003
+++ ZODB3/ZODB/Connection.py	Fri Jan  2 14:57:12 2004
@@ -672,8 +672,9 @@
 
     def sync(self):
         self.getTransaction().abort()
-        sync=getattr(self._storage, 'sync', 0)
-        if sync != 0: sync()
+        sync = getattr(self._storage, 'sync', 0)
+        if sync:
+            sync()
         self._flush_invalidations()
 
     def getDebugInfo(self):
@@ -693,13 +694,11 @@
             self._store_count = 0
         return res
 
-
-    ######################################################################
-    # Just plain weird. Don't try this at home kids.
     def exchange(self, old, new):
-        oid=old._p_oid
-        new._p_oid=oid
-        new._p_jar=self
-        new._p_changed=1
+        # called by a ZClasses method that isn't executed by the test suite
+        oid = old._p_oid
+        new._p_oid = oid
+        new._p_jar = self
+        new._p_changed = 1
         self.getTransaction().register(new)
-        self._cache[oid]=new
+        self._cache[oid] = new




More information about the Zope-Checkins mailing list