Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #8523

Merged
merged 5 commits into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
3 changes: 2 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Release 3.4.0 (in development)
==============================

artsiomkaltovich marked this conversation as resolved.
Show resolved Hide resolved
Dependencies
------------

Expand Down Expand Up @@ -98,6 +97,8 @@ Features added

Bugs fixed
----------
* #8522: ``__bool__`` method isn't called now by autodoc module, so it won't
lead to side effect or direct failure in case it generates an error.
artsiomkaltovich marked this conversation as resolved.
Show resolved Hide resolved

Testing
--------
Expand Down
2 changes: 1 addition & 1 deletion sphinx/ext/autodoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def is_filtered_inherited_member(name: str) -> bool:
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:
Expand Down