- Add pr_34.patch for DRF 3.13 compatibility OBS-URL: https://build.opensuse.org/request/show/977287 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-rest-framework-braces?expand=0&rev=5
25 lines
860 B
Diff
25 lines
860 B
Diff
commit 904b1c4032ce7e3b695ffb122a219a8c07f06fe9
|
|
Author: John Vandenberg <jayvdb@gmail.com>
|
|
Date: Sun May 15 09:28:54 2022 +0800
|
|
|
|
find_function_args: Include spec.kwonlyargs
|
|
|
|
Fixes https://github.com/dealertrack/django-rest-framework-braces/issues/32
|
|
|
|
diff --git a/drf_braces/utils.py b/drf_braces/utils.py
|
|
index 6730c17..e6323e5 100644
|
|
--- a/drf_braces/utils.py
|
|
+++ b/drf_braces/utils.py
|
|
@@ -12,7 +12,10 @@ def find_function_args(func):
|
|
"""
|
|
try:
|
|
spec = inspect.getfullargspec(func) if hasattr(inspect, 'getfullargspec') else inspect.getargspec(func)
|
|
- return [i for i in spec[0] if i not in IGNORE_ARGS]
|
|
+ arg_list = spec[0]
|
|
+ if hasattr(spec, 'kwonlyargs'):
|
|
+ arg_list += spec.kwonlyargs
|
|
+ return [i for i in arg_list if i not in IGNORE_ARGS]
|
|
except TypeError:
|
|
return []
|
|
|