From 4ba0a97f85483add9a03db4031d9c2bd6f11dd11 Mon Sep 17 00:00:00 2001 From: ljhuang Date: Thu, 4 Aug 2022 09:00:56 +0800 Subject: Replace abc.abstractproperty with property and abc.abstractmethod Replace abc.abstractproperty with property and abc.abstractmethod, as abc.abstractproperty has been deprecated since python3.3[1] [1]https://docs.python.org/3.8/whatsnew/3.3.html?highlight=deprecated#abc Change-Id: I5e86211323c5e08553a5c777c0b6d1d85f95e1a9 --- cliff/display.py | 6 ++++-- cliff/tests/test_app.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cliff/display.py b/cliff/display.py index 5ea0713..44eadd5 100644 --- a/cliff/display.py +++ b/cliff/display.py @@ -29,11 +29,13 @@ class DisplayCommandBase(command.Command, metaclass=abc.ABCMeta): cmd_name=cmd_name) self._formatter_plugins = self._load_formatter_plugins() - @abc.abstractproperty + @property + @abc.abstractmethod def formatter_namespace(self): "String specifying the namespace to use for loading formatter plugins." - @abc.abstractproperty + @property + @abc.abstractmethod def formatter_default(self): "String specifying the name of the default formatter." diff --git a/cliff/tests/test_app.py b/cliff/tests/test_app.py index d38861c..bffbb70 100644 --- a/cliff/tests/test_app.py +++ b/cliff/tests/test_app.py @@ -321,7 +321,7 @@ class TestOptionParser(base.TestBase): return parser def take_action(self, parsed_args): - assert(parsed_args.end == '123') + assert parsed_args.end == '123' class MyCommandManager(commandmanager.CommandManager): def load_commands(self, namespace): -- cgit v1.2.1