Merge branch '3.4.x' into 3.x

This commit is contained in:
Takeshi KOMIYA 2021-01-08 01:18:53 +09:00
commit d9569a84a2
2 changed files with 14 additions and 2 deletions

11
CHANGES
View File

@ -49,7 +49,7 @@ Bugs fixed
Testing
--------
Release 3.4.3 (in development)
Release 3.4.4 (in development)
==============================
Dependencies
@ -70,6 +70,15 @@ Bugs fixed
Testing
--------
Release 3.4.3 (released Jan 08, 2021)
=====================================
Bugs fixed
----------
* #8655: autodoc: Failed to generate document if target module contains an
object that raises an exception on ``hasattr()``
Release 3.4.2 (released Jan 04, 2021)
=====================================

View File

@ -153,7 +153,10 @@ def mock(modnames: List[str]) -> Generator[None, None, None]:
def ismock(subject: Any) -> bool:
"""Check if the object is mocked."""
# check the object has '__sphinx_mock__' attribute
if not hasattr(subject, '__sphinx_mock__'):
try:
if safe_getattr(subject, '__sphinx_mock__', None) is None:
return False
except AttributeError:
return False
# check the object is mocked module