Merge pull request #9212 from tk0miya/9210_viewcode_crashed_on_merging

Fix #9210: viewcode: crashed if non importable modules found on parallel build
This commit is contained in:
Takeshi KOMIYA 2021-05-12 00:56:36 +09:00 committed by GitHub
commit 415e255dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -16,6 +16,8 @@ Features added
Bugs fixed
----------
* #9210: viewcode: crashed if non importable modules found on parallel build
Testing
--------

View File

@ -150,10 +150,11 @@ def env_merge_info(app: Sphinx, env: BuildEnvironment, docnames: Iterable[str],
if modname not in env._viewcode_modules: # type: ignore
env._viewcode_modules[modname] = entry # type: ignore
else:
used = env._viewcode_modules[modname][2] # type: ignore
for fullname, docname in entry[2].items():
if fullname not in used:
used[fullname] = docname
if env._viewcode_modules[modname]: # type: ignore
used = env._viewcode_modules[modname][2] # type: ignore
for fullname, docname in entry[2].items():
if fullname not in used:
used[fullname] = docname
def env_purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None: