From 2f5345a6d8c49fdb473dbd60cd075aee2b08f4bf Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 1 Dec 2022 10:23:19 +0100 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 Co-Authored-By: manchandavishal Change-Id: Ie9cdf3e87a06a0af8cf36c8bbdef0f14336e8f70 --- watcher_dashboard/utils/errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/watcher_dashboard/utils/errors.py b/watcher_dashboard/utils/errors.py index a505f4e..7f3a9c5 100644 --- a/watcher_dashboard/utils/errors.py +++ b/watcher_dashboard/utils/errors.py @@ -39,7 +39,8 @@ def handle_errors(error_message, error_default=None, request_arg=None): def decorator(func): # XXX This is an ugly hack for finding the 'request' argument. if request_arg is None: - for _request_arg, name in enumerate(inspect.getargspec(func).args): + for _request_arg, name in enumerate( + inspect.getfullargspec(func).args): if name == 'request': break else: