Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Swap to use getfullargspec instead of getargspec #102

Merged
merged 2 commits into from
Nov 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docfx_yaml/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _update_friendly_package_name(path):
args = []
try:
if _type in [METHOD, FUNCTION]:
argspec = inspect.getargspec(obj) # noqa
argspec = inspect.getfullargspec(obj) # noqa
for arg in argspec.args:
args.append({'id': arg})
if argspec.defaults:
Expand All @@ -289,8 +289,8 @@ def _update_friendly_package_name(path):
# Match the defaults with the count
if 'object at 0x' not in str(default):
args[len(args) - cut_count + count]['defaultValue'] = str(default)
except Exception:
print("Can't get argspec for {}: {}".format(type(obj), name))
except Exception as e:
print("Can't get argspec for {}: {}. Exception: {}".format(type(obj), name, e))

if name in app.env.docfx_signature_funcs_methods:
sig = app.env.docfx_signature_funcs_methods[name]
Expand Down