[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/component/site.py Added back check to make sure we don't accept a single spec rather

Jim Fulton jim at zope.com
Sun Jan 22 13:02:38 EST 2006


Log message for revision 41415:
  Added back check to make sure we don't accept a single spec rather
  than a sequence is specs to provideAdapter and subscribe.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/component/site.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/component/site.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/site.py	2006-01-22 17:47:39 UTC (rev 41414)
+++ Zope3/branches/jim-adapter/src/zope/component/site.py	2006-01-22 18:02:38 UTC (rev 41415)
@@ -157,6 +157,9 @@
         >>> registry.queryMultiAdapter((O1(), O2()), R1, '').__class__
         <class 'zope.component.site.O3'>
         """
+        if ISpecification.providedBy(required):
+            raise TypeError('the required argument should be a list of'
+                            ' interfaces, not a single interface')
         required = tuple(map(_spec, required))
         self._registrations.append(
             AdapterRegistration(required, provided, name, factory, info),
@@ -192,6 +195,9 @@
         SubscriptionRegistration(('R1',), 'P2', 'c1', 'd1')
         SubscriptionRegistration(('R1',), 'P2', 'c2', 'd2')
         """
+        if ISpecification.providedBy(required):
+            raise TypeError('the required argument should be a list of'
+                            ' interfaces, not a single interface')
 
         required = tuple(map(_spec, required))
 



More information about the Zope3-Checkins mailing list