[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/app/component/__init__.py Updated to use __bases__ rather than deprecated 'next' attr.

Jim Fulton jim at zope.com
Sun Apr 2 12:59:49 EDT 2006


Log message for revision 66313:
  Updated to use __bases__ rather than deprecated 'next' attr.
  

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

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/component/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/__init__.py	2006-04-02 16:59:47 UTC (rev 66312)
+++ Zope3/branches/jim-adapter/src/zope/app/component/__init__.py	2006-04-02 16:59:49 UTC (rev 66313)
@@ -17,6 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 import zope.component
+import zope.app.component.interfaces
 from zope.app import zapi
 
 # BBB: Will go away in 3.3.
@@ -42,11 +43,13 @@
     `default` is returned.
     """
     sm = zapi.getSiteManager(context)
-    if zope.component.globalregistry.IGlobalSiteManager.providedBy(sm):
+    if not zope.app.component.interfaces.ILocalSiteManager.providedBy(sm):
         return default
-    if sm.next is None:
+
+    bases = sm.__bases__
+    if not bases:
         return zapi.getGlobalSiteManager()
-    return sm.next
+    return bases[0]
 
 
 def getNextUtility(context, interface, name=''):



More information about the Zope3-Checkins mailing list