Skip to content

Commit

Permalink
Fix #7451: autodoc: failed with non-string __doc__ member
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Apr 10, 2020
1 parent b316375 commit 0760f9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -22,6 +22,8 @@ Bugs fixed
* #7418: std domain: duplication warning for glossary terms is case insensitive
* #7438: C++, fix merging overloaded functions in parallel builds.
* #7422: autodoc: fails with ValueError when using autodoc_mock_imports
* #7451: autodoc: fails with AttributeError when an object returns non-string
object as a ``__doc__`` member

Testing
--------
Expand Down
3 changes: 3 additions & 0 deletions sphinx/ext/autodoc/__init__.py
Expand Up @@ -557,6 +557,9 @@ def is_filtered_inherited_member(name: str) -> bool:
isattr = False

doc = getdoc(member, self.get_attr, self.env.config.autodoc_inherit_docstrings)
if not isinstance(doc, str):
# Ignore non-string __doc__
doc = None

# if the member __doc__ is the same as self's __doc__, it's just
# inherited and therefore not the member's doc
Expand Down

0 comments on commit 0760f9f

Please sign in to comment.