diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-07-19 09:11:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-19 09:11:12 +0300 |
commit | 5850d6b8f9569171d73f8bc5abbc9d646f5d4a77 (patch) | |
tree | 22f3b461e83cab839f7551a28cf9c5ed4e9c8891 /sphinx/environment | |
parent | f65ef0e62352093326ca5000cc6940830d897b46 (diff) | |
parent | 69fc1953c668afcb3c6545c7c4eb8bf7237aa3d0 (diff) |
Merge pull request #7982 from tk0miya/7840_optimize_bootstrap
Close #7840: i18n: Optimize the dependencies check on bootstrap
Diffstat (limited to 'sphinx/environment')
-rw-r--r-- | sphinx/environment/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index 1e58542bb..cf3364494 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -387,11 +387,11 @@ class BuildEnvironment: # add catalog mo file dependency repo = CatalogRepository(self.srcdir, self.config.locale_dirs, self.config.language, self.config.source_encoding) + mo_paths = {c.domain: c.mo_path for c in repo.catalogs} for docname in self.found_docs: domain = docname_to_domain(docname, self.config.gettext_compact) - for catalog in repo.catalogs: - if catalog.domain == domain: - self.dependencies[docname].add(catalog.mo_path) + if domain in mo_paths: + self.dependencies[docname].add(mo_paths[domain]) except OSError as exc: raise DocumentError(__('Failed to scan documents in %s: %r') % (self.srcdir, exc)) from exc |