pylint: Fix deprecated-decorator

Pylint 2.9 introduced new checker:
> The decorator is marked as deprecated and will be removed in the
  future.

- @abstractproperty has been deprecated since Python3.3 [0]
- @abstractclassmethod has been deprecated since Python3.3 [1]

[0]: https://docs.python.org/3/library/abc.html#abc.abstractproperty
[1]: https://docs.python.org/3/library/abc.html#abc.abstractclassmethod

Fixes: https://pagure.io/freeipa/issue/9117
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Levin
2021-07-29 13:07:54 +03:00
committed by Rob Crittenden
parent 516adf40f8
commit 31a9eb3783
2 changed files with 5 additions and 3 deletions

View File

@@ -104,7 +104,8 @@ class Resolver(abc.ABC):
logger.info('Applying resolver state for host %s: %s', self.host, state)
self.current_state = state
@abc.abstractclassmethod
@classmethod
@abc.abstractmethod
def is_our_resolver(cls, host):
"""Checks if the class is appropriate for managing resolver on the host.
"""

View File

@@ -5,7 +5,7 @@ from __future__ import absolute_import
import six
from abc import ABCMeta, abstractproperty
from abc import ABCMeta, abstractmethod
from collections import namedtuple
import itertools
@@ -21,7 +21,8 @@ class InstallerTestBase(six.with_metaclass(ABCMeta, object)):
OPTS_DICT = {}
# don't allow creating classes with tested_cls unspecified
@abstractproperty
@property
@abstractmethod
def tested_cls(self):
return None