Closes #814: autodoc: Guard against strange type objects that don't have

``__bases__``.
This commit is contained in:
Georg Brandl 2014-01-10 21:01:24 +01:00
parent fdb3a5ada8
commit 7a26dd0730
2 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,11 @@ Bugs fixed
* #751: Allow production lists longer than a page in LaTeX by using longtable.
* #764: Always look for stopwords lowercased in JS search.
* #814: autodoc: Guard against strange type objects that don't have
``__bases__``.
Documentation
-------------

View File

@ -1052,7 +1052,7 @@ class ClassDocumenter(ModuleLevelDocumenter):
# add inheritance info, if wanted
if not self.doc_as_attr and self.options.show_inheritance:
self.add_line(u'', '<autodoc>')
if len(self.object.__bases__):
if hasattr(self.object, '__bases__') and len(self.object.__bases__):
bases = [b.__module__ == '__builtin__' and
u':class:`%s`' % b.__name__ or
u':class:`%s.%s`' % (b.__module__, b.__name__)