@@ -103,7 +103,7 @@ def _patched_base_admonition_run(self: BaseAdmonition) -> Any:
103
103
104
104
def _patched_text_indent (self : Text , * args : Any ) -> Any :
105
105
_ , line = self .state_machine .get_source_and_line ()
106
- result = orig_text_indent (self , * args )
106
+ result = orig_text_indent (self , * args ) # type: ignore[no-untyped-call]
107
107
node = self .parent [- 1 ]
108
108
if node .tagname == "system_message" :
109
109
node = self .parent [- 2 ]
@@ -114,6 +114,7 @@ def _patched_text_indent(self: Text, *args: Any) -> Any:
114
114
def _patched_body_doctest (
115
115
self : Body , _match : None , _context : None , next_state : str | None
116
116
) -> tuple [list [Any ], str | None , list [Any ]]:
117
+ assert self .document .current_line is not None # noqa: S101
117
118
line = self .document .current_line + 1
118
119
data = "\n " .join (self .state_machine .get_text_block ())
119
120
n = nodes .doctest_block (data , data )
@@ -128,9 +129,9 @@ def _patch_line_numbers() -> None:
128
129
129
130
When the line numbers are missing, we have a hard time placing the :rtype:.
130
131
"""
131
- Text .indent = _patched_text_indent
132
+ Text .indent = _patched_text_indent # type: ignore[method-assign]
132
133
BaseAdmonition .run = _patched_base_admonition_run # type: ignore[method-assign,assignment]
133
- Body .doctest = _patched_body_doctest
134
+ Body .doctest = _patched_body_doctest # type: ignore[method-assign]
134
135
135
136
136
137
def install_patches (app : Sphinx ) -> None :
0 commit comments