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

Commit

Permalink
Fix Bug: suppress object addresses in doc (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannanwang1 authored and bianliu1013 committed Aug 9, 2017
1 parent 6043d76 commit c10d490
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docfx_yaml/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ def _update_friendly_package_name(path):
if argspec.defaults:
for count, default in enumerate(argspec.defaults):
cut_count = len(argspec.defaults)
# Only add defaultValue when str(default) doesn't contain object address string(object at 0x)
# inspect.getargspec method will return wrong defaults which contain object address for some default values, like sys.stdout
# Match the defaults with the count
args[len(args) - cut_count + count]['defaultValue'] = str(default)
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))

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='sphinx-docfx-yaml',
version='1.2.19',
version='1.2.20',
author='Eric Holscher',
author_email='eric@ericholscher.com',
url='https://github.com/ericholscher/sphinx-docfx-yaml',
Expand Down

0 comments on commit c10d490

Please sign in to comment.