diff options
author | Georg Brandl <georg@python.org> | 2009-09-04 00:17:41 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-04 00:17:41 +0200 |
commit | 0d029eeb9c6cb98236fa44fb182879fa9c1a7ad7 (patch) | |
tree | ad5f103bf19d47a95911967612f6c30add7e31b4 /sphinx/ext/autodoc.py | |
parent | 65c81df70f50c0211426ad45f437ec382691e6ee (diff) | |
parent | 894cac3390a0b1878874e310e4f786357d2a0f1a (diff) | |
download | sphinx-git-0d029eeb9c6cb98236fa44fb182879fa9c1a7ad7.tar.gz |
merge with trunk
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 2b280d673..705853c20 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -14,8 +14,7 @@ import re import sys import inspect -from types import ModuleType, FunctionType, BuiltinFunctionType, MethodType, \ - ClassType +from types import FunctionType, BuiltinFunctionType, MethodType, ClassType from docutils import nodes from docutils.utils import assemble_option_dict @@ -626,11 +625,15 @@ class Documenter(object): # try to also get a source code analyzer for attribute docs try: self.analyzer = ModuleAnalyzer.for_module(self.real_modname) - # parse right now, to get PycodeErrors on parsing - self.analyzer.parse() + # parse right now, to get PycodeErrors on parsing (results will + # be cached anyway) + self.analyzer.find_attr_docs() except PycodeError, err: # no source file -- e.g. for builtin and C modules self.analyzer = None + # at least add the module.__file__ as a dependency + if hasattr(self.module, '__file__') and self.module.__file__: + self.directive.filename_set.add(self.module.__file__) else: self.directive.filename_set.add(self.analyzer.srcname) |