[Zope-Checkins] CVS: Zope2 - DT_Util.py:1.81.2.1
andreas@serenade.digicool.com
andreas@serenade.digicool.com
Thu, 5 Jul 2001 08:17:28 -0400
Update of /cvs-repository/Zope2/lib/python/DocumentTemplate
In directory serenade:/tmp/cvs-serv17781/lib/python/DocumentTemplate
Modified Files:
Tag: Zope-2_4-branch
DT_Util.py
Log Message:
Collector # 2375: fixed broken 'Find' tab functionality
--- Updated File DT_Util.py in package Zope2 --
--- DT_Util.py 2001/06/21 19:08:59 1.81
+++ DT_Util.py 2001/07/05 12:17:18 1.81.2.1
@@ -145,6 +145,7 @@
_marker = [] # Create a new marker object.
def careful_getattr(md, inst, name, default=_marker):
+
get = md.guarded_getattr
if get is None:
get = getattr
@@ -156,12 +157,14 @@
return default
def careful_hasattr(md, inst, name):
+
get = md.guarded_getattr
if get is None:
get = getattr
try:
get(inst, name)
- except (AttributeError, ValidationError):
+ return 0
+ except (AttributeError, ValidationError, KeyError):
return 0
else:
return 1