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

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

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
-------------

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):