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 <manchandavishal143@gmail.com> Change-Id: Ie9cdf3e87a06a0af8cf36c8bbdef0f14336e8f70
This commit is contained in:
parent
b526383eba
commit
2f5345a6d8
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user