mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9844: autodoc: Failed to preserve defvalues for partial function
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -23,6 +23,8 @@ Bugs fixed
|
|||||||
decorated by functools.lru_cache
|
decorated by functools.lru_cache
|
||||||
* #9879: autodoc: AttributeError is raised on building document for an object
|
* #9879: autodoc: AttributeError is raised on building document for an object
|
||||||
having invalid __doc__ atribute
|
having invalid __doc__ atribute
|
||||||
|
* #9844: autodoc: Failed to process a function wrapped with functools.partial if
|
||||||
|
:confval:`autodoc_preserve_defaults` enabled
|
||||||
* #9872: html: Class namespace collision between autodoc signatures and
|
* #9872: html: Class namespace collision between autodoc signatures and
|
||||||
docutils-0.17
|
docutils-0.17
|
||||||
* #9864: mathjax: Failed to render equations via MathJax v2. The loading method
|
* #9864: mathjax: Failed to render equations via MathJax v2. The loading method
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ def update_defvalue(app: Sphinx, obj: Any, bound_method: bool) -> None:
|
|||||||
lines = inspect.getsource(obj).splitlines()
|
lines = inspect.getsource(obj).splitlines()
|
||||||
if lines[0].startswith((' ', r'\t')):
|
if lines[0].startswith((' ', r'\t')):
|
||||||
lines.insert(0, '') # insert a dummy line to follow what get_function_def() does.
|
lines.insert(0, '') # insert a dummy line to follow what get_function_def() does.
|
||||||
except OSError:
|
except (OSError, TypeError):
|
||||||
lines = []
|
lines = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user