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
This commit is contained in:
parent
2980dfc44f
commit
e94c2b3d34
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user