Merge pull request #8523 from ArtyomKaltovich/fix_bool_issue

fix #8522: sphinx could lead to `__bool__` method call, what can lead to side effect or direct failure in case it generate an error bug
This commit is contained in:
Takeshi KOMIYA
2020-12-12 15:15:57 +09:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -78,6 +78,7 @@ Bugs fixed
* #8437: Makefile: ``make clean`` with empty BUILDDIR is dangerous
* #8352: std domain: Failed to parse an option that starts with bracket
* #8519: LaTeX: Prevent page brake in the middle of a seealso
* #8522: fix ``__bool__`` method could be called by autodoc module.
Testing
--------

View File

@@ -716,7 +716,7 @@ class Documenter:
isprivate = membername.startswith('_')
keep = False
if safe_getattr(member, '__sphinx_mock__', False):
if safe_getattr(member, '__sphinx_mock__', None) is not None:
# mocked module or object
pass
elif self.options.exclude_members and membername in self.options.exclude_members: