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:
@@ -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 {}
|
||||
|
Reference in New Issue
Block a user