[Zope-Checkins] CVS: Zope/lib/python/OFS - Traversable.py:1.15.6.4
Casey Duncan
casey@zope.com
Wed, 26 Feb 2003 11:49:30 -0500
Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv3618/lib/python/OFS
Modified Files:
Tag: Zope-2_6-branch
Traversable.py
Log Message:
Fix failure mode in (un)restrictedTraverse so that it raises a NotFound error wh
en traversing from a non-mapping object, rather than an obscure AttributeError o
n __getitem__
=== Zope/lib/python/OFS/Traversable.py 1.15.6.3 => 1.15.6.4 ===
--- Zope/lib/python/OFS/Traversable.py:1.15.6.3 Tue Jan 14 09:55:40 2003
+++ Zope/lib/python/OFS/Traversable.py Wed Feb 26 11:48:59 2003
@@ -150,7 +150,11 @@
else:
o = get(object, name, M)
if o is M:
- o=object[name]
+ try:
+ o=object[name]
+ except AttributeError:
+ # Raise a NotFound for easier debugging
+ raise 'NotFound', name
if (restricted and not securityManager.validate(
object, object, N, o)):
raise Unauthorized, name