diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-02-28 06:56:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-28 06:56:58 +0300 |
commit | 2c987897eb7e43df05455968ac8be9860c8d5af3 (patch) | |
tree | 50b19d60e1e66976f1ebd2455414dbdd6d89d14b /sphinx/ext | |
parent | 4f7f3304b16330f7112c36ef15c9d928f95e337d (diff) | |
parent | 255b4aee051e3318eb8fe42e606f321183736f8c (diff) |
Merge pull request #8935 from tk0miya/8933_viewcode_backlink_on_parallel_build
Fix #8933: viewcode: Failed to create back-links on parallel build
Diffstat (limited to 'sphinx/ext')
-rw-r--r-- | sphinx/ext/viewcode.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py index 6bedf2e1c..c98ff0c88 100644 --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -146,7 +146,14 @@ def env_merge_info(app: Sphinx, env: BuildEnvironment, docnames: Iterable[str], if not hasattr(env, '_viewcode_modules'): env._viewcode_modules = {} # type: ignore # now merge in the information from the subprocess - env._viewcode_modules.update(other._viewcode_modules) # type: ignore + for modname, entry in other._viewcode_modules.items(): # type: ignore + 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 def env_purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None: |