From 6ec10208ea799f417b612273485e081b5b07eb21 Mon Sep 17 00:00:00 2001 From: Fernando Perez Date: Wed, 14 Apr 2010 17:17:53 +0000 Subject: Fix bug where __init__ was accessed for objects that might not have it. --- doc/sphinxext/numpydoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/sphinxext/numpydoc.py') diff --git a/doc/sphinxext/numpydoc.py b/doc/sphinxext/numpydoc.py index 06c4523ec..5eb8c439c 100644 --- a/doc/sphinxext/numpydoc.py +++ b/doc/sphinxext/numpydoc.py @@ -73,7 +73,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 -- cgit v1.2.1