[Zope-Checkins] CVS: Zope/lib/python/App - Common.py:1.16.2.1
Casey Duncan
casey@zope.com
Fri, 15 Nov 2002 14:20:38 -0500
Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv15755
Modified Files:
Tag: Zope-2_6-branch
Common.py
Log Message:
Minor change to is_acquired function: __getitem__ lookups now use the wrapped parent to allow the parent to acquire things like CMF tools during lookup. Note that this relies on the unwritten assumption that __getitem__ will not acquire things as getattr will.
=== Zope/lib/python/App/Common.py 1.16 => 1.16.2.1 ===
--- Zope/lib/python/App/Common.py:1.16 Tue Sep 3 02:09:04 2002
+++ Zope/lib/python/App/Common.py Fri Nov 15 14:20:37 2002
@@ -90,7 +90,9 @@
# Use __getitem__ as opposed to has_key to avoid TTW namespace
# issues, and to support the most minimal mapping objects
try:
- if aq_base(parent[absId]) is aq_base(ob):
+ # We assume that getitem will not acquire which
+ # is the standard behavior for Zope objects
+ if aq_base(ob.aq_parent[absId]) is aq_base(ob):
# This object is an item of the aq_parent, its not acquired
return 0
except KeyError: