[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - Traversers.py:1.5

Jim Fulton jim@zope.com
Mon, 11 Nov 2002 14:15:33 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv8206

Modified Files:
	Traversers.py 
Log Message:
Changed the way view lookup was done to avoid masking errors
ComponentLookupErrors occuring during view computation.


=== Zope3/lib/python/Zope/App/ZopePublication/Traversers.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/ZopePublication/Traversers.py:1.4	Thu Jul 11 14:21:35 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/Traversers.py	Mon Nov 11 14:15:33 2002
@@ -20,7 +20,7 @@
 from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
 from Zope.Publisher.XMLRPC.IXMLRPCPublisher import IXMLRPCPublisher
 from Zope.ComponentArchitecture \
-     import getView, getDefaultViewName
+     import queryView, getView, getDefaultViewName
 from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
 
 class SimpleComponentTraverser:
@@ -42,12 +42,10 @@
     def publishTraverse(self, request, name):
         ob = self.context
         from Zope.ComponentArchitecture.GlobalViewService import viewService
-        try:
-            return getView(ob, name, request)
-        except ComponentLookupError:
+        view = queryView(ob, name, request)
+        if view is None:
             raise NotFound(ob, name)
-
-
+        return view
 
 class FileContentTraverser(SimpleComponentTraverser):
     """Browser traverser for file content.