From 7a26dd07301b5e612c3368539ceb579af622167f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 10 Jan 2014 21:01:24 +0100 Subject: [PATCH] Closes #814: autodoc: Guard against strange type objects that don't have ``__bases__``. --- CHANGES | 5 +++++ sphinx/ext/autodoc.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 122aee4f9..6959cb9d7 100644 --- a/CHANGES +++ b/CHANGES @@ -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 ------------- diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 67b6fe4ee..e26a6b85d 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -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'', '') - 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__)