From 393dcee0959b9c124f24f3ea0c80ed9d32d50612 2010-04-14 08:18:12 From: Fernando Perez Date: 2010-04-14 08:18:12 Subject: [PATCH] Fix small numpydoc bug so docs build out of the box. Already asked on numpy list if the fix is OK to upstream. --- diff --git a/docs/sphinxext/numpydoc.py b/docs/sphinxext/numpydoc.py index ff6c44c..ada1ca4 100644 --- a/docs/sphinxext/numpydoc.py +++ b/docs/sphinxext/numpydoc.py @@ -68,7 +68,8 @@ def mangle_docstrings(app, what, name, obj, options, lines, 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