[Numpy-svn] r8333 - trunk/doc/sphinxext

numpy-svn@scip... numpy-svn@scip...
Wed Apr 14 12:17:53 CDT 2010


Author: fperez
Date: 2010-04-14 12:17:53 -0500 (Wed, 14 Apr 2010)
New Revision: 8333

Modified:
   trunk/doc/sphinxext/numpydoc.py
Log:
Fix bug where __init__ was accessed for objects that might not have it.


Modified: trunk/doc/sphinxext/numpydoc.py
===================================================================
--- trunk/doc/sphinxext/numpydoc.py	2010-04-13 16:25:36 UTC (rev 8332)
+++ trunk/doc/sphinxext/numpydoc.py	2010-04-14 17:17:53 UTC (rev 8333)
@@ -73,7 +73,8 @@
 def mangle_signature(app, what, name, obj, options, sig, retann):
     # Do not try to inspect classes that don't define `__init__`
     if (inspect.isclass(obj) and
-        'initializes x; see ' in pydoc.getdoc(obj.__init__)):
+        (not hasattr(obj, '__init__') or
+        'initializes x; see ' in pydoc.getdoc(obj.__init__))):
         return '', ''
 
     if not (callable(obj) or hasattr(obj, '__argspec_is_invalid_')): return



More information about the Numpy-svn mailing list