summaryrefslogtreecommitdiff
path: root/sphinx/pycode/parser.py
diff options
context:
space:
mode:
authordanieleades <33452915+danieleades@users.noreply.github.com>2022-08-14 15:27:16 +0100
committerGitHub <noreply@github.com>2022-08-14 15:27:16 +0100
commitc3d8a7d50b5aa15ef0f94ad68ee27a9ecde240df (patch)
tree56c037b41a741070c7b2cb03a227f979bea52d96 /sphinx/pycode/parser.py
parentee48589fc0e828c305daf5324cae7fca6436b127 (diff)
downloadsphinx-git-c3d8a7d50b5aa15ef0f94ad68ee27a9ecde240df.tar.gz
Fix some static typing errors (#10745)
Diffstat (limited to 'sphinx/pycode/parser.py')
-rw-r--r--sphinx/pycode/parser.py4
1 files changed, 2 insertions, 2 deletions
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.