Closes #932: autodoc: Do not crash if `__doc__` is not a string.

This commit is contained in:
Georg Brandl committed 2014-01-10 21:51:51 +01:00
1 parent 166ac0d5ca
commit 38d73fb056
2 files changed
+4 -1

No files matched your search

+2
View File
@@ -28,6 +28,8 @@ Bugs fixed
* #814: autodoc: Guard against strange type objects that don't have
``__bases__``.
* #932: autodoc: Do not crash if ``__doc__`` is not a string.
Documentation
-------------
+2 -1
View File
@@ -450,9 +450,10 @@ class Documenter(object):
# into lines
if isinstance(docstring, unicode):
return [prepare_docstring(docstring, ignore)]
elif docstring:
elif isinstance(docstring, str): # this will not trigger on Py3
return [prepare_docstring(force_decode(docstring, encoding),
ignore)]
# ... else it is something strange, let's ignore it
return []
def process_doc(self, docstrings):