From 50fdb44f6a91f70042f446dd61dc822146a35684 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Wed, 2 May 2018 15:55:43 +0300 Subject: [PATCH] Py2 and Py3 compatibility for metaclass interfaces --- certbot/interfaces.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/certbot/interfaces.py b/certbot/interfaces.py index 8061f0de3..f5858a7fd 100644 --- a/certbot/interfaces.py +++ b/certbot/interfaces.py @@ -1,5 +1,6 @@ """Certbot client interfaces.""" import abc +import six import zope.interface # pylint: disable=no-self-argument,no-method-argument,no-init,inherit-non-class @@ -607,6 +608,7 @@ class IReporter(zope.interface.Interface): # installer wants to perform an update during the run or install subcommand, it # should do so when :func:`IInstaller.deploy_cert` is called. +@six.add_metaclass(abc.ABCMeta) class GenericUpdater(object): """Interface for update types not currently specified by Certbot. @@ -619,8 +621,6 @@ class GenericUpdater(object): """ - __metaclass__ = abc.ABCMeta - @abc.abstractmethod def generic_updates(self, domain, *args, **kwargs): """Perform any update types defined by the installer. @@ -637,6 +637,7 @@ class GenericUpdater(object): """ +@six.add_metaclass(abc.ABCMeta) class RenewDeployer(object): """Interface for update types run when a lineage is renewed @@ -648,8 +649,6 @@ class RenewDeployer(object): be called from the installer code. """ - __metaclass__ = abc.ABCMeta - @abc.abstractmethod def renew_deploy(self, lineage, *args, **kwargs): """Perform updates defined by installer when a certificate has been renewed