autodoc: The change of autodoc-process-docstring is cached (refs: #7469)

This commit is contained in:
Takeshi KOMIYA 2020-04-30 01:20:29 +09:00
parent d59584f409
commit 4a944d4ff2
2 changed files with 6 additions and 1 deletions

View File

@ -72,6 +72,8 @@ Bugs fixed
* #6703: autodoc: incremental build does not work for imported objects
* #7564: autodoc: annotations not to be shown for descriptors
* #6588: autodoc: Decorated inherited method has no documentation
* #7469: autodoc: The change of autodoc-process-docstring for variables is
cached unexpectedly
* #7535: sphinx-autogen: crashes when custom template uses inheritance
* #7536: sphinx-autogen: crashes when template uses i18n feature
* #2785: html: Bad alignment of equation links

View File

@ -468,7 +468,10 @@ class Documenter:
key = ('.'.join(self.objpath[:-1]), self.objpath[-1])
if key in attr_docs:
no_docstring = True
docstrings = [attr_docs[key]]
# make a copy of docstring for attributes to avoid cache
# the change of autodoc-process-docstring event.
docstrings = [list(attr_docs[key])]
for i, line in enumerate(self.process_doc(docstrings)):
self.add_line(line, sourcename, i)