Skip to content

Commit

Permalink
find_function_args: Include spec.kwonlyargs
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed May 15, 2022
1 parent 5fe4f56 commit 904b1c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drf_braces/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

Expand Down

0 comments on commit 904b1c4

Please sign in to comment.