diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index 7a25c2bfade..f2c327de106 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -397,7 +397,7 @@ def __init__(self, document: nodes.document, builder: TextBuilder) -> None: Used by visit_* and depart_* functions in conjunction with the tree traversal. Make sure that the pops correspond to the pushes. """ - self.context = [] + self.context: list[str] = [] def add_text(self, text: str) -> None: self.states[-1].append((-1, text))