summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorFernando Perez <fperez@fperez.org>2010-04-14 17:17:53 +0000
committerFernando Perez <fperez@fperez.org>2010-04-14 17:17:53 +0000
commit6ec10208ea799f417b612273485e081b5b07eb21 (patch)
tree2fdfc63cf23d2500ae017ff1baba2246d076d6e1 /doc
parent514a01f6fe494456c09b9e66d910ee514e6aa9d1 (diff)
downloadnumpy-6ec10208ea799f417b612273485e081b5b07eb21.tar.gz
Fix bug where __init__ was accessed for objects that might not have it.
Diffstat (limited to 'doc')
-rw-r--r--doc/sphinxext/numpydoc.py3
1 files changed, 2 insertions, 1 deletions
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