From 05b6a3333603595ef99131286b8ccbf1e48136f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Guimar=C3=A3es=20de=20Medeiros?= Date: Tue, 1 Dec 2020 12:36:32 +0100 Subject: inherit from object is not required for py3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3f3b1dca78e2e9b2515231ccc6600b64f31039fb Signed-off-by: Moisés Guimarães de Medeiros --- doc/source/reference/configuration-files.rst | 2 +- doc/source/reference/defining.rst | 2 +- oslo_config/cfg.py | 10 +++++----- oslo_config/generator.py | 2 +- oslo_config/iniparser.py | 2 +- oslo_config/sources/__init__.py | 6 +++--- oslo_config/tests/test_cfg.py | 2 +- oslo_config/tests/test_generator.py | 2 +- oslo_config/tests/test_types.py | 2 +- oslo_config/types.py | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/source/reference/configuration-files.rst b/doc/source/reference/configuration-files.rst index b4e299d..435a135 100644 --- a/doc/source/reference/configuration-files.rst +++ b/doc/source/reference/configuration-files.rst @@ -7,7 +7,7 @@ and ``--config-dir``: .. code-block:: python - class ConfigOpts(object): + class ConfigOpts: def __call__(self, ...): diff --git a/doc/source/reference/defining.rst b/doc/source/reference/defining.rst index d8e1866..19a70ec 100644 --- a/doc/source/reference/defining.rst +++ b/doc/source/reference/defining.rst @@ -81,7 +81,7 @@ the option is referenced: .. code-block:: python - class ExtensionManager(object): + class ExtensionManager: enabled_apis_opt = cfg.ListOpt(...) diff --git a/oslo_config/cfg.py b/oslo_config/cfg.py index 5324e52..39a9878 100644 --- a/oslo_config/cfg.py +++ b/oslo_config/cfg.py @@ -424,7 +424,7 @@ def _report_deprecation(format_str, format_dict): @functools.total_ordering -class Opt(object): +class Opt: """Base class for all configuration options. @@ -809,7 +809,7 @@ class Opt(object): return hash(self) < hash(another) -class DeprecatedOpt(object): +class DeprecatedOpt: """Represents a Deprecated option. @@ -1416,7 +1416,7 @@ class _ConfigDirOpt(Opt): return kwargs -class OptGroup(object): +class OptGroup: """Represents a group of opts. @@ -3155,7 +3155,7 @@ class ConfigOpts(abc.Mapping): """Return the number of options and option groups.""" return len(self._group._opts) - class SubCommandAttr(object): + class SubCommandAttr: """Helper class. @@ -3189,7 +3189,7 @@ class ConfigOpts(abc.Mapping): except AttributeError: raise NoSuchOptError(name) - class StrSubWrapper(object): + class StrSubWrapper: """Helper class. diff --git a/oslo_config/generator.py b/oslo_config/generator.py index 277036b..9fdde09 100644 --- a/oslo_config/generator.py +++ b/oslo_config/generator.py @@ -174,7 +174,7 @@ def _format_type_name(opt_type): return 'unknown value' -class _OptFormatter(object): +class _OptFormatter: """Format configuration option descriptions to a file.""" diff --git a/oslo_config/iniparser.py b/oslo_config/iniparser.py index 90218e4..b79ee08 100644 --- a/oslo_config/iniparser.py +++ b/oslo_config/iniparser.py @@ -23,7 +23,7 @@ class ParseError(Exception): return 'at line %d, %s: %r' % (self.lineno, self.msg, self.line) -class BaseParser(object): +class BaseParser: lineno = 0 parse_exc = ParseError diff --git a/oslo_config/sources/__init__.py b/oslo_config/sources/__init__.py index 92b557d..a1fa0c5 100644 --- a/oslo_config/sources/__init__.py +++ b/oslo_config/sources/__init__.py @@ -33,10 +33,10 @@ import abc _NoValue = object() -class ConfigurationSourceDriver(object, metaclass=abc.ABCMeta): +class ConfigurationSourceDriver(metaclass=abc.ABCMeta): """A backend driver option for oslo.config. - For each group name listed in **config_source** on the **DEFAULT** group, + For each group name listed in **config_source** in the **DEFAULT** group, a :class:`ConfigurationSourceDriver` is responsible for creating one new instance of a :class:`ConfigurationSource`. The proper driver class to be used is selected based on the **driver** option inside each one of the @@ -96,7 +96,7 @@ class ConfigurationSourceDriver(object, metaclass=abc.ABCMeta): """ -class ConfigurationSource(object, metaclass=abc.ABCMeta): +class ConfigurationSource(metaclass=abc.ABCMeta): """A configuration source option for oslo.config. A configuration source is able to fetch configuration values based on diff --git a/oslo_config/tests/test_cfg.py b/oslo_config/tests/test_cfg.py index ac45780..505cb00 100644 --- a/oslo_config/tests/test_cfg.py +++ b/oslo_config/tests/test_cfg.py @@ -3958,7 +3958,7 @@ class FindFileTestCase(BaseTestCase): class OptDumpingTestCase(BaseTestCase): - class FakeLogger(object): + class FakeLogger: def __init__(self, test_case, expected_lvl): self.test_case = test_case diff --git a/oslo_config/tests/test_generator.py b/oslo_config/tests/test_generator.py index 9a27aac..d75b4d8 100644 --- a/oslo_config/tests/test_generator.py +++ b/oslo_config/tests/test_generator.py @@ -1638,7 +1638,7 @@ class GeneratorRaiseErrorTestCase(base.BaseTestCase): class FakeException(Exception): pass - class FakeEP(object): + class FakeEP: def __init__(self): self.name = 'callback_is_expected' diff --git a/oslo_config/tests/test_types.py b/oslo_config/tests/test_types.py index 8ab4a09..dd56b98 100644 --- a/oslo_config/tests/test_types.py +++ b/oslo_config/tests/test_types.py @@ -37,7 +37,7 @@ class ConfigTypeTests(unittest.TestCase): MyString() -class TypeTestHelper(object): +class TypeTestHelper: def setUp(self): super(TypeTestHelper, self).setUp() self.type_instance = self.type diff --git a/oslo_config/types.py b/oslo_config/types.py index a1f75c9..72242cb 100644 --- a/oslo_config/types.py +++ b/oslo_config/types.py @@ -30,7 +30,7 @@ import netaddr import rfc3986 -class ConfigType(object, metaclass=abc.ABCMeta): +class ConfigType(metaclass=abc.ABCMeta): def __init__(self, type_name='unknown type'): self.type_name = type_name -- cgit v1.2.1