[Zope-Checkins]
SVN: Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py
Merged from old philikon-aq-and-__parent__ branch:
Philipp von Weitershausen
philikon at philikon.de
Tue Jul 24 17:15:18 EDT 2007
Log message for revision 78319:
Merged from old philikon-aq-and-__parent__ branch:
Log message for revision 77024:
Read that mail again, we agreed on raising an AttributeError instead of returning None.
Changed:
U Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py
-=-
Modified: Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py 2007-07-24 21:02:03 UTC (rev 78318)
+++ Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py 2007-07-24 21:15:17 UTC (rev 78319)
@@ -179,6 +179,13 @@
# Make *extra* sure that the wrapper isn't used to access
# __call__, etc.
if name.startswith('__'):
+ # Acquisition will nowadays try to do an getattr on all
+ # objects which aren't Acquisition wrappers, asking for a
+ # __parent__ pointer. We don't want to raise Unauthorized
+ # in this case but simply an AttributeError.
+ if name in ('__parent__', '__name__'):
+ raise AttributeError(name)
+
self.__you_lose()
return guarded_getattr(self._wrapped, name, default)
More information about the Zope-Checkins
mailing list