Fix inspect.getargspec() deprecation warning

DeprecationWarning: inspect.getargspec() is deprecated,
use inspect.signature() or inspect.getfullargspec()

[1] https://docs.python.org/3/library/inspect.html#inspect.getargspec

Story: 2010694
Task: 47804

Change-Id: Ica14e66d2130dbc5949a6567673e68e8bb450061
This commit is contained in:
likui 2021-05-10 17:40:26 +08:00 committed by wu.chunyang
parent 71d7b18319
commit 18a83dbaf1
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class Commands(object):
def execute(self):
exec_method = getattr(self, CONF.action.name)
args = inspect.getargspec(exec_method)
args = inspect.getfullargspec(exec_method)
args.args.remove('self')
kwargs = {}
for arg in args.args:

View File

@ -174,7 +174,7 @@ class MethodInspector(object):
@cached_property
def argspec(self):
return inspect.getargspec(self._func)
return inspect.getfullargspec(self._func)
def __str__(self):
optionals = ["[{0}=<{0}>]".format(k) for k, v in self.optional_args]