Closes #848: Always take the newest code in incremental rebuilds with the :mod:sphinx.ext.viewcode extension.

This commit is contained in:
Georg Brandl committed 2014-01-19 09:54:24 +01:00
1 parent f9758086b0
commit e5c1a81ed8
2 files changed
+14 -11

No files matched your search

+3
View File
@@ -99,6 +99,9 @@ Bugs fixed
* #1285: Avoid name clashes between C domain objects and section titles.
* #848: Always take the newest code in incremental rebuilds with the
:mod:`sphinx.ext.viewcode` extension.
Documentation
-------------
+11 -11
View File
@@ -24,17 +24,17 @@ def doctree_read(app, doctree):
def has_tag(modname, fullname, docname):
entry = env._viewcode_modules.get(modname, None)
if entry is None:
try:
analyzer = ModuleAnalyzer.for_module(modname)
except Exception:
env._viewcode_modules[modname] = False
return
try:
analyzer = ModuleAnalyzer.for_module(modname)
except Exception:
env._viewcode_modules[modname] = False
return
if not isinstance(analyzer.code, unicode):
code = analyzer.code.decode(analyzer.encoding)
else:
code = analyzer.code
if entry is None or entry[0] != code:
analyzer.find_tags()
if not isinstance(analyzer.code, unicode):
code = analyzer.code.decode(analyzer.encoding)
else:
code = analyzer.code
entry = code, analyzer.tags, {}
env._viewcode_modules[modname] = entry
elif entry is False:
@@ -142,7 +142,7 @@ def collect_pages(app):
if not modnames:
return
app.builder.info(' _modules/index')
app.builder.info(' _modules/index', nonl=True)
html = ['\n']
# the stack logic is needed for using nested lists for submodules
stack = ['']