[Zope3-checkins] CVS: Zope3/src/zope/app/traversing - adapters.py:1.7

Jim Fulton jim@zope.com
Fri, 23 May 2003 13:51:54 -0400


Update of /cvs-repository/Zope3/src/zope/app/traversing
In directory cvs.zope.org:/tmp/cvs-serv14601/src/zope/app/traversing

Modified Files:
	adapters.py 
Log Message:
Added a special case for traversing dictionaries. We traverse lots of
these in ZPT and it doen't make sense to go through the CA for them.


=== Zope3/src/zope/app/traversing/adapters.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/traversing/adapters.py:1.6	Mon Apr 28 09:18:38 2003
+++ Zope3/src/zope/app/traversing/adapters.py	Fri May 23 13:51:53 2003
@@ -219,6 +219,10 @@
         nm = name
 
     if traversable is None:
+        if obj.__class__ == dict:
+            # Special-case dicts
+            return obj[name]
+        
         traversable = queryAdapter(obj, ITraversable, None)
         if traversable is None:
             raise NotFoundError('No traversable adapter found', obj)