Fix import_object if the object has no '__name__' attribute.

This commit is contained in:
Christophe de Vienne 2009-03-30 19:11:20 +02:00
parent 07ef8c9f99
commit 48c4bf0cb3

View File

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