mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7158 from tk0miya/7151_env.indexentries_setter
Fix #7151: crashed when extension assigns a value to env.indexentries
This commit is contained in:
commit
9f237445bd
1
CHANGES
1
CHANGES
@ -20,6 +20,7 @@ Bugs fixed
|
|||||||
as a value
|
as a value
|
||||||
* #7156: autodoc: separator for keyword only arguments is not shown
|
* #7156: autodoc: separator for keyword only arguments is not shown
|
||||||
* #7146: autodoc: IndexError is raised on suppressed type_comment found
|
* #7146: autodoc: IndexError is raised on suppressed type_comment found
|
||||||
|
* #7151: crashed when extension assigns a value to ``env.indexentries``
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -755,6 +755,14 @@ class BuildEnvironment:
|
|||||||
domain = cast(IndexDomain, self.get_domain('index'))
|
domain = cast(IndexDomain, self.get_domain('index'))
|
||||||
return domain.entries
|
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
|
from sphinx.errors import NoUri # NOQA
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user