Change zope's implements to be a class decorator.

When attempting to import any module that uses zope.interface.implements
in Python 3, a TypeError is raised; it reads:

    TypeError: Class advice impossible in Python3.  Use the @implementer
    class decorator instead.

Following the listed advice seems to function in Python 3.
This commit is contained in:
Roy Wellington Ⅳ
2016-02-20 00:37:40 -08:00
parent cf3343605a
commit b6142c13d6
15 changed files with 18 additions and 23 deletions
@@ -34,11 +34,10 @@ SHARED_MODULES = {
"vhost_alias"}
@zope.interface.implementer(interfaces.IConfiguratorProxy)
class Proxy(apache_common.Proxy):
"""Wraps the ApacheConfigurator for Apache 2.4 tests"""
zope.interface.implements(interfaces.IConfiguratorProxy)
def __init__(self, args):
"""Initializes the plugin with the given command line args"""
super(Proxy, self).__init__(args)
@@ -19,12 +19,11 @@ APACHE_VERSION_REGEX = re.compile(r"Apache/([0-9\.]*)", re.IGNORECASE)
APACHE_COMMANDS = ["apachectl", "a2enmod", "a2dismod"]
@zope.interface.implementer(interfaces.IConfiguratorProxy)
class Proxy(configurators_common.Proxy):
# pylint: disable=too-many-instance-attributes
"""A common base for Apache test configurators"""
zope.interface.implements(interfaces.IConfiguratorProxy)
def __init__(self, args):
"""Initializes the plugin with the given command line args"""
super(Proxy, self).__init__(args)
@@ -12,10 +12,10 @@ from letsencrypt import interfaces
logger = logging.getLogger(__name__)
@zope.interface.implementer(interfaces.IValidator)
class Validator(object):
# pylint: disable=no-self-use
"""Collection of functions to test a live webserver's configuration"""
zope.interface.implements(interfaces.IValidator)
def certificate(self, cert, name, alt_host=None, port=443):
"""Verifies the certificate presented at name is cert"""