mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4931: autodoc: crashed when subclass of mocked class are processed by napoleon module
This commit is contained in:
parent
d7a25433ce
commit
cff194d5dd
2
CHANGES
2
CHANGES
@ -41,6 +41,8 @@ Bugs fixed
|
||||
* #4919: node.asdom() crashes if toctree has :numbered: option
|
||||
* #4914: autodoc: Parsing error when using dataclasses without default values
|
||||
* #4931: autodoc: crashed when handler for autodoc-skip-member raises an error
|
||||
* #4931: autodoc: crashed when subclass of mocked class are processed by
|
||||
napoleon module
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -23,7 +23,7 @@ from sphinx.util.inspect import isenumclass, safe_getattr
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Generator, List, Optional, Tuple # NOQA
|
||||
from typing import Any, Callable, Dict, Generator, Iterator, List, Optional, Tuple # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -41,7 +41,7 @@ class _MockObject(object):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
# type: (Any, Any) -> None
|
||||
pass
|
||||
self.__qualname__ = ''
|
||||
|
||||
def __len__(self):
|
||||
# type: () -> int
|
||||
@ -52,8 +52,8 @@ class _MockObject(object):
|
||||
return False
|
||||
|
||||
def __iter__(self):
|
||||
# type: () -> None
|
||||
pass
|
||||
# type: () -> Iterator
|
||||
return iter([])
|
||||
|
||||
def __mro_entries__(self, bases):
|
||||
# type: (Tuple) -> Tuple
|
||||
|
Loading…
Reference in New Issue
Block a user