summaryrefslogtreecommitdiff
path: root/src/zope/component/interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/component/interface.py')
-rw-r--r--src/zope/component/interface.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/zope/component/interface.py b/src/zope/component/interface.py
index 2317149..f03770d 100644
--- a/src/zope/component/interface.py
+++ b/src/zope/component/interface.py
@@ -14,12 +14,11 @@
"""Interface utility functions
"""
from zope.interface import alsoProvides
+from zope.interface.interfaces import ComponentLookupError
from zope.interface.interfaces import IInterface
-from zope.interface.interfaces import ComponentLookupError
from zope.component._api import getSiteManager
from zope.component._api import queryUtility
-from zope.component._compat import CLASS_TYPES
def provideInterface(id, interface, iface_type=None, info=''):
@@ -31,10 +30,10 @@ def provideInterface(id, interface, iface_type=None, info=''):
Previously it was always registered in the global site manager.
"""
if not id:
- id = "%s.%s" % (interface.__module__, interface.__name__)
+ id = "{}.{}".format(interface.__module__, interface.__name__)
if not IInterface.providedBy(interface):
- if not isinstance(interface, CLASS_TYPES):
+ if not isinstance(interface, type):
raise TypeError(id, "is not an interface or class")
return
@@ -96,7 +95,7 @@ def searchInterfaceUtilities(context, search_string=None, base=None):
def getInterfaceAllDocs(interface):
- iface_id = '%s.%s' % (interface.__module__, interface.__name__)
+ iface_id = '{}.{}'.format(interface.__module__, interface.__name__)
docs = [str(iface_id).lower(),
str(interface.__doc__).lower()]
@@ -118,4 +117,4 @@ def nameToInterface(context, id):
def interfaceToName(context, interface):
if interface is None:
return 'None'
- return '%s.%s' % (interface.__module__, interface.__name__)
+ return '{}.{}'.format(interface.__module__, interface.__name__)