Skip to content

Commit

Permalink
Merge pull request #8892 from tk0miya/8888
Browse files Browse the repository at this point in the history
Sometimes _viewcode_modules can be False; don't crash when it is
  • Loading branch information
tk0miya committed Feb 15, 2021
2 parents f993f76 + ba0fa06 commit 89a1175
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sphinx/ext/viewcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ def env_merge_info(app: Sphinx, env: BuildEnvironment, docnames: Iterable[str],
def env_purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None:
modules = getattr(env, '_viewcode_modules', {})

for modname, (code, tags, used, refname) in list(modules.items()):
for modname, entry in list(modules.items()):
if entry is False:
continue

code, tags, used, refname = entry
for fullname in list(used):
if used[fullname] == docname:
used.pop(fullname)
Expand Down

0 comments on commit 89a1175

Please sign in to comment.