[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Transience/TransientObject.py hasattr->getattr changes in order to reduce conflict potential.

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


Log message for revision 24914:
hasattr->getattr changes in order to reduce conflict potential.



-=-
Modified: Zope/trunk/lib/python/Products/Transience/TransientObject.py
===================================================================
--- Zope/trunk/lib/python/Products/Transience/TransientObject.py	2004-05-23 20:29:25 UTC (rev 24913)
+++ Zope/trunk/lib/python/Products/Transience/TransientObject.py	2004-05-23 21:04:05 UTC (rev 24914)
@@ -87,7 +87,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
@@ -103,7 +104,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