[Zope3-checkins] CVS: Packages3/Interface - Implements.py:1.15

Gary Poster gary at zope.com
Wed Jan 21 13:53:30 EST 2004


Update of /cvs-repository/Packages3/Interface
In directory cvs.zope.org:/tmp/cvs-serv18262

Modified Files:
	Implements.py 
Log Message:
This checkin reinstates the fix to make this package usable with the Zope 3 head.  Another fix to Zope 3 itself is pending to make this package usable with the Zope 3 head.




=== Packages3/Interface/Implements.py 1.14 => 1.15 ===
--- Packages3/Interface/Implements.py:1.14	Wed Jan 21 10:40:29 2004
+++ Packages3/Interface/Implements.py	Wed Jan 21 13:53:30 2004
@@ -22,8 +22,9 @@
 from zope.interface import classImplements as assertTypeImplements
 from zope.interface import providedBy as objectImplements
 from zope.interface import implementedBy as instancesOfObjectImplements
+from zope.interface.declarations import Declaration
+from Interface.Exceptions import BadImplements
 
-from zope.interface.declarations import InterfaceSpecification
 def visitImplements(implements, object, visitor):
     """Call visitor for each interace.
 
@@ -32,8 +33,12 @@
     If the visitor returns anything true, the loop stops.
     This does not, and should not, visit superinterfaces.
     """
-
-    for interface in InterfaceSpecification(implements):
+    # used little, so not worrying too much about efficiency or cheesiness
+    try:
+        seq = Declaration(implements)
+    except TypeError:
+        raise BadImplements
+    for interface in seq:
         if visitor(interface):
             break
 




More information about the Zope3-Checkins mailing list