mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #2243: ignore strange docstring types in class docs, like already done for method docs.
This commit is contained in:
parent
46d7e8558e
commit
8167a9b7ad
1
CHANGES
1
CHANGES
@ -9,6 +9,7 @@ Bugs fixed
|
||||
* Fix line numbers was not shown on warnings in LaTeX and texinfo builders
|
||||
* Fix line numbers was not shown on warnings of indecies
|
||||
* #2026: Fix LaTeX builder rais error if parsed-literal includes links
|
||||
* #2243: Ignore strange docstring types for classes, do not crash
|
||||
|
||||
Release 1.3.4 (released Jan 12, 2016)
|
||||
=====================================
|
||||
|
@ -1170,9 +1170,11 @@ class ClassDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter):
|
||||
docstrings.append(initdocstring)
|
||||
doc = []
|
||||
for docstring in docstrings:
|
||||
if not isinstance(docstring, text_type):
|
||||
docstring = force_decode(docstring, encoding)
|
||||
doc.append(prepare_docstring(docstring))
|
||||
if isinstance(docstring, text_type):
|
||||
doc.append(prepare_docstring(docstring, ignore))
|
||||
elif isinstance(docstring, str): # this will not trigger on Py3
|
||||
doc.append(prepare_docstring(force_decode(docstring, encoding),
|
||||
ignore))
|
||||
return doc
|
||||
|
||||
def add_content(self, more_content, no_docstring=False):
|
||||
|
Loading…
Reference in New Issue
Block a user