diff options
author | Georg Brandl <georg@python.org> | 2009-01-10 20:46:13 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-01-10 20:46:13 +0100 |
commit | d0e0acaaa1278627d70f7bbb7d823c79d3546b58 (patch) | |
tree | 6b277aae0685e0161a0f5f896fb599d5ffb1d27f /sphinx/ext/autodoc.py | |
parent | 4d345c8de394778b0e50ce4a13982f4a1173a378 (diff) | |
parent | beb141c1c79e5c7485f8ffef7eacf9212be3bcc3 (diff) | |
download | sphinx-git-d0e0acaaa1278627d70f7bbb7d823c79d3546b58.tar.gz |
merge in trunk
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index be3e3f0ff..d0512f2be 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -166,7 +166,7 @@ def between(marker, what=None, keepempty=False): def isdescriptor(x): """Check if the object is some kind of descriptor.""" for item in '__get__', '__set__', '__delete__': - if callable(getattr(x, item, None)): + if hasattr(getattr(x, item, None), '__call__'): return True return False @@ -380,6 +380,8 @@ class RstGenerator(object): # try to also get a source code analyzer for attribute docs try: analyzer = ModuleAnalyzer.for_module(mod) + # parse right now, to get PycodeErrors on parsing + analyzer.parse() except PycodeError, err: # no source file -- e.g. for builtin and C modules analyzer = None |