[Zope3-checkins] CVS: Zope3/src/zope/app/publication - traversers.py:1.5

Jim Fulton jim@zope.com
Mon, 2 Jun 2003 07:05:16 -0400


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

Modified Files:
	traversers.py 
Log Message:
Fixed a bug in some testing support code. The code was trying to test
whether an object had any interfaces by checking if it had an
__implements__ attribute. It should have been using the interface
declaration api.


=== Zope3/src/zope/app/publication/traversers.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/publication/traversers.py:1.4	Thu May  1 15:35:26 2003
+++ Zope3/src/zope/app/publication/traversers.py	Mon Jun  2 07:05:15 2003
@@ -15,6 +15,7 @@
 
 __metaclass__ = type
 
+from zope.interface import providedBy
 from zope.publisher.interfaces import Unauthorized, NotFound
 from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
@@ -78,7 +79,7 @@
     def browserDefault(self, request):
         ob = self.context
 
-        if hasattr(ob, '__implements__'):
+        if providedBy(ob):
 
             view_name = getDefaultViewName(ob, request)