summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorChristophe de Vienne <cdevienne@gmail.com>2009-03-30 19:11:20 +0200
committerChristophe de Vienne <cdevienne@gmail.com>2009-03-30 19:11:20 +0200
commit48c4bf0cb388b8960e49639d19fb45c5880b6952 (patch)
tree6e91cd3963f2d1ce55c1821166392e3505e33920 /sphinx/ext/autodoc.py
parent07ef8c9f9944a02d11fe27e9dfe3817140c92f18 (diff)
downloadsphinx-git-48c4bf0cb388b8960e49639d19fb45c5880b6952.tar.gz
Fix import_object if the object has no '__name__' attribute.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 72d500297..ce5eac780 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -841,7 +841,10 @@ class ClassDocumenter(ModuleLevelDocumenter):
# if the class is documented under another name, document it
# as data/attribute
if ret:
- self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
+ if hasattr(self.object, '__name__'):
+ self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
+ else:
+ self.doc_as_attr = True
return ret
def format_args(self):