[Zope-Checkins] CVS: Zope/lib/python/Products/Transience - TransientObject.py:1.9.68.3

Chris McDonough chrism at plope.com
Sun May 23 17:04:55 EDT 2004


Update of /cvs-repository/Zope/lib/python/Products/Transience
In directory cvs.zope.org:/tmp/cvs-serv22057

Modified Files:
      Tag: Zope-2_7-branch
	TransientObject.py 
Log Message:
hasattr->getattr fixes to prevent conflicts from potentially being swallowed.


=== Zope/lib/python/Products/Transience/TransientObject.py 1.9.68.2 => 1.9.68.3 ===
--- Zope/lib/python/Products/Transience/TransientObject.py:1.9.68.2	Sun May 23 00:19:02 2004
+++ Zope/lib/python/Products/Transience/TransientObject.py	Sun May 23 17:04:53 2004
@@ -88,7 +88,8 @@
     #
 
     def invalidate(self):
-        if hasattr(self, '_invalid'):
+        # hasattr hides conflicts
+        if getattr(self, '_invalid', _notfound) is not _notfound:
             # we dont want to invalidate twice
             return
         trans_ob_container = None
@@ -104,7 +105,9 @@
         self._invalid = None
 
     def isValid(self):
-        return not hasattr(self, '_invalid')
+        # hasattr hides conflicts
+        if getattr(self, '_invalid', _notfound) is _notfound:
+            return 1
 
     def getLastAccessed(self):
         return self._last_accessed




More information about the Zope-Checkins mailing list