Replace deprecated inspect.getargspec

inspect.getargspec was deprecated since Python 3.0 and
inspect.getfullargspec is its replacement with correct handling of
function annotations and keyword-only parameters[1].

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

Change-Id: Id843607e7a416e15f24b820979564193f8e9ab2b
This commit is contained in:
Takashi Kajinami
2021-07-15 20:55:32 +09:00
parent 1d9c1e82f3
commit ab23f27e85

View File

@@ -145,7 +145,7 @@ def make_arguments_section(category_name, cmd_name, arguments, defaults):
def get_defaults(func):
"""Return a map of argument:default_value for specified function."""
spec = inspect.getargspec(func)
spec = inspect.getfullargspec(func)
if spec.defaults:
return dict(zip(spec.args[-len(spec.defaults):], spec.defaults))
return {}