From ec2a079753c49caed4ae866277bb979e6340e298 Mon Sep 17 00:00:00 2001 From: "wu.shiming" Date: Fri, 13 Aug 2021 16:51:31 +0800 Subject: [PATCH] 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: I2d3591e41ae35479b613487a81c43548c7cd3f9c --- cyborgclient/common/cliutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyborgclient/common/cliutils.py b/cyborgclient/common/cliutils.py index 0ac7693..0993a15 100644 --- a/cyborgclient/common/cliutils.py +++ b/cyborgclient/common/cliutils.py @@ -90,7 +90,7 @@ def validate_args(fn, *args, **kwargs): :param arg: the positional arguments supplied :param kwargs: the keyword arguments supplied """ - argspec = inspect.getargspec(fn) + argspec = inspect.getfullargspec(fn) num_defaults = len(argspec.defaults or []) required_args = argspec.args[:len(argspec.args) - num_defaults]