@@ -103,7 +103,7 @@ def _patched_base_admonition_run(self: BaseAdmonition) -> Any:
103103
104104def _patched_text_indent (self : Text , * args : Any ) -> Any :
105105 _ , 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]
107107 node = self .parent [- 1 ]
108108 if node .tagname == "system_message" :
109109 node = self .parent [- 2 ]
@@ -114,6 +114,7 @@ def _patched_text_indent(self: Text, *args: Any) -> Any:
114114def _patched_body_doctest (
115115 self : Body , _match : None , _context : None , next_state : str | None
116116) -> tuple [list [Any ], str | None , list [Any ]]:
117+ assert self .document .current_line is not None # noqa: S101
117118 line = self .document .current_line + 1
118119 data = "\n " .join (self .state_machine .get_text_block ())
119120 n = nodes .doctest_block (data , data )
@@ -128,9 +129,9 @@ def _patch_line_numbers() -> None:
128129
129130 When the line numbers are missing, we have a hard time placing the :rtype:.
130131 """
131- Text .indent = _patched_text_indent
132+ Text .indent = _patched_text_indent # type: ignore[method-assign]
132133 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]
134135
135136
136137def install_patches (app : Sphinx ) -> None :
0 commit comments