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].


Change-Id: I2f5c95b9dd00a2460e81788343c47a5206589693
This commit is contained in:
Takashi Kajinami 2021-07-15 20:29:55 +09:00
parent 2980dfc44f
commit e94c2b3d34
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ def handle_errors(error_message, error_default=None, request_arg=None):
def decorator(func):
if request_arg is None:
_request_arg = 'request'
if _request_arg not in inspect.getargspec(func).args:
if _request_arg not in inspect.getfullargspec(func).args:
raise RuntimeError(
"The handle_errors decorator requires 'request' as "
"an argument of the function or method being decorated")