Commits

Christophe de Vienne committed 8dbd45d

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

  • Participants
  • Parent commits fd52839

Comments (0)

Files changed (1)

File sphinx/ext/autodoc.py

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