Update of /cvs-repository/Zope/lib/python/zExceptions In directory cvs.zope.org:/tmp/cvs-serv32028/lib/python/zExceptions
Modified Files: Tag: tseaver-hasattr_geddon-branch TracebackSupplement.py Log Message: - Removed all uses of the 'hasattr' builtin from the core, where the object being tested derives (or might) from Persistent. XXX: currently, this branch imports a 'safe_hasattr' from ZODB.utils, which adds a dependency on ZODB for some packages; we probably need a better location, and perhas a C implementation? === Zope/lib/python/zExceptions/TracebackSupplement.py 1.1.2.1 => 1.1.2.1.34.1 === --- Zope/lib/python/zExceptions/TracebackSupplement.py:1.1.2.1 Mon Jul 21 12:38:36 2003 +++ Zope/lib/python/zExceptions/TracebackSupplement.py Sat May 28 20:41:39 2005 @@ -1,13 +1,15 @@ # Stock __traceback_supplement__ implementations +from ZODB.utils import safe_hasattr + class PathTracebackSupplement: """Implementation of ITracebackSupplement""" pp = None def __init__(self, object): self.object = object - if hasattr(object, 'getPhysicalPath'): + if safe_hasattr(object, 'getPhysicalPath'): self.pp = '/'.join(object.getPhysicalPath()) - if hasattr(object, 'absolute_url'): + if safe_hasattr(object, 'absolute_url'): self.source_url = '%s/manage_main' % object.absolute_url() def getInfo(self, as_html=0): _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins