diff options
author | ljhuang <huang.liujie@99cloud.net> | 2022-08-04 09:00:56 +0800 |
---|---|---|
committer | ljhuang <huang.liujie@99cloud.net> | 2022-08-04 13:03:13 +0800 |
commit | 4ba0a97f85483add9a03db4031d9c2bd6f11dd11 (patch) | |
tree | 995abe2d59b710313045fc977a24bef7cf49ae0c | |
parent | f782f42b94446a3401b644c93a9f120e77d5fb9e (diff) | |
download | cliff-4ba0a97f85483add9a03db4031d9c2bd6f11dd11.tar.gz |
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
-rw-r--r-- | cliff/display.py | 6 | ||||
-rw-r--r-- | 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): |