Skip to content

Commit

Permalink
Stop falling back to inspect.getargspec since this is only for Python 2.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 574605912
  • Loading branch information
yilei authored and edward-bot committed Oct 18, 2023
1 parent b6872b9 commit 0fbed1f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions edward2/tensorflow/program_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ def _get_function_inputs(f, src_kwargs):
if hasattr(f, "_func"): # functions returned by tf.make_template
f = f._func # pylint: disable=protected-access

try: # getargspec was deprecated in Python 3.6
argspec = inspect.getfullargspec(f) # pytype: disable=module-attr
except AttributeError:
argspec = inspect.getargspec(f)
argspec = inspect.getfullargspec(f)

fkwargs = {k: v for k, v in src_kwargs.items() if k in argspec.args}
return fkwargs

0 comments on commit 0fbed1f

Please sign in to comment.