Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes _viewcode_modules can be False; don't crash when it is #8892

Merged
merged 2 commits into from
Feb 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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