diff options
author | Dustin Spicuzza <dustin@virtualroadside.com> | 2021-02-15 08:16:58 +0300 |
---|---|---|
committer | Dustin Spicuzza <dustin@virtualroadside.com> | 2021-02-15 08:16:58 +0300 |
commit | 5fe6a62aaafbd8f970dbcf95aa6344c4b784a68e (patch) | |
tree | 7db8bece70e99bd698ee5b12403ae910f747e152 /sphinx/ext | |
parent | c60cc0c1788a1667913fa36f4c77ea90c4ff809e (diff) |
Sometimes _viewcode_modules can be False; don't crash when it is
- Fixes #8880
Diffstat (limited to 'sphinx/ext')
-rw-r--r-- | sphinx/ext/viewcode.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py index 21cff6a03..6bedf2e1c 100644 --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -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) |