diff options
| author | Tres Seaver <tseaver@palladion.com> | 2009-12-17 01:40:22 +0000 |
|---|---|---|
| committer | Tres Seaver <tseaver@palladion.com> | 2009-12-17 01:40:22 +0000 |
| commit | 55c93f71fcb38ccd81549e24f428ba68c96b165f (patch) | |
| tree | 3c4a73381e1b64014c036b97761e4e0ad5979fe6 /src | |
| parent | 17b49b33bdd34182e85f91422184c885cc4a33b2 (diff) | |
| download | zope-interface-55c93f71fcb38ccd81549e24f428ba68c96b165f.tar.gz | |
Cleanups: make pyflakes happy.
Diffstat (limited to 'src')
| -rw-r--r-- | src/zope/interface/interface.py | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/zope/interface/interface.py b/src/zope/interface/interface.py index 5fb096d..f950478 100644 --- a/src/zope/interface/interface.py +++ b/src/zope/interface/interface.py @@ -12,18 +12,15 @@ # ############################################################################## """Interface object implementation - -$Id$ """ - from __future__ import generators import sys -import warnings -import weakref from types import FunctionType -from ro import ro +import weakref + from zope.interface.exceptions import Invalid +from zope.interface.ro import ro CO_VARARGS = 4 @@ -163,6 +160,10 @@ class SpecificationBasePy(object): __call__ = isOrExtends SpecificationBase = SpecificationBasePy +try: + from _zope_interface_coptimizations import SpecificationBase +except ImportError: + pass _marker = object() class InterfaceBasePy(object): @@ -197,18 +198,21 @@ class InterfaceBasePy(object): adapter = hook(self, obj) if adapter is not None: return adapter + InterfaceBase = InterfaceBasePy +try: + from _zope_interface_coptimizations import InterfaceBase +except ImportError: + pass -adapter_hooks = [] +adapter_hooks = [] try: - import _zope_interface_coptimizations + from _zope_interface_coptimizations import adapter_hooks except ImportError: pass -else: - from _zope_interface_coptimizations import SpecificationBase - from _zope_interface_coptimizations import InterfaceBase, adapter_hooks + class Specification(SpecificationBase): """Specifications @@ -801,11 +805,14 @@ def _wire(): from zope.interface.interfaces import IMethod classImplements(Method, IMethod) - from zope.interface.interfaces import IInterface, ISpecification + from zope.interface.interfaces import IInterface classImplements(InterfaceClass, IInterface) + + from zope.interface.interfaces import ISpecification classImplements(Specification, ISpecification) # We import this here to deal with module dependencies. -from zope.interface.declarations import providedBy, implementedBy +from zope.interface.declarations import implementedBy +from zope.interface.declarations import providedBy from zope.interface.exceptions import InvalidInterface from zope.interface.exceptions import BrokenImplementation |
