From c3d8a7d50b5aa15ef0f94ad68ee27a9ecde240df Mon Sep 17 00:00:00 2001 From: danieleades <33452915+danieleades@users.noreply.github.com> Date: Sun, 14 Aug 2022 15:27:16 +0100 Subject: Fix some static typing errors (#10745) --- sphinx/pycode/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sphinx/pycode/parser.py') diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py index ff1135c25..1019400a8 100644 --- a/sphinx/pycode/parser.py +++ b/sphinx/pycode/parser.py @@ -29,7 +29,7 @@ def get_assign_targets(node: ast.AST) -> List[ast.expr]: return [node.target] # type: ignore -def get_lvar_names(node: ast.AST, self: ast.arg = None) -> List[str]: +def get_lvar_names(node: ast.AST, self: Optional[ast.arg] = None) -> List[str]: """Convert assignment-AST to variable names. This raises `TypeError` if the assignment does not create new variable:: @@ -128,7 +128,7 @@ class TokenProcessor: """Returns specified line.""" return self.buffers[lineno - 1] - def fetch_token(self) -> Token: + def fetch_token(self) -> Optional[Token]: """Fetch the next token from source code. Returns ``None`` if sequence finished. -- cgit v1.2.1