diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-15 20:11:13 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-16 14:22:50 +0300 |
commit | 151b4afde2ddcc2afac7ff5e8e2d035c547c62ae (patch) | |
tree | 5c312e5081c0a74ee611c7b93edb60143dd114e9 /sphinx/environment | |
parent | 1339948dce47a6636bab5b89cf56dddeb37c0f88 (diff) |
Fix #7151: crashed when extension assigns a value to ``env.indexentries``
Diffstat (limited to 'sphinx/environment')
-rw-r--r-- | sphinx/environment/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index 4ccdce7f1..f1ae6024d 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -755,6 +755,14 @@ class BuildEnvironment: domain = cast(IndexDomain, self.get_domain('index')) return domain.entries + @indexentries.setter + def indexentries(self, entries: Dict[str, List[Tuple[str, str, str, str, str]]]) -> None: + warnings.warn('env.indexentries() is deprecated. Please use IndexDomain instead.', + RemovedInSphinx40Warning, stacklevel=2) + from sphinx.domains.index import IndexDomain + domain = cast(IndexDomain, self.get_domain('index')) + domain.data['entries'] = entries + from sphinx.errors import NoUri # NOQA |