From e94c2b3d34f189fa91c80d0ea7a743f9b5c9cac8 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 15 Jul 2021 20:29:55 +0900 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: I2f5c95b9dd00a2460e81788343c47a5206589693 --- mistraldashboard/handle_errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mistraldashboard/handle_errors.py b/mistraldashboard/handle_errors.py index 4d929af..4633cf9 100644 --- a/mistraldashboard/handle_errors.py +++ b/mistraldashboard/handle_errors.py @@ -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")