Skip to content

Commit

Permalink
Replace getargspec with getfullargspec
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Nov 22, 2024
1 parent 16977ae commit 553aafe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ def _api(f):
:returns: Wrapper function to turn a Python function into a basic API function
"""
# Determine required and optional argument names from the function signature.
a_pos, a_var, a_kw, a_defaults = inspect.getargspec(f)
full_argspec = inspect.getfullargspec(f)
a_pos = full_argspec.args
a_var = full_argspec.varargs
a_kw = full_argspec.varkw
a_defaults = full_argspec.defaults

a_pos = a_pos[1:] # ignore callback/context param.

required = set(a_pos if a_defaults is None else a_pos[:-len(a_defaults)])
Expand Down

0 comments on commit 553aafe

Please sign in to comment.