More precise types in preserve_defaults.py (#12385)

This commit is contained in:
Jelle Zijlstra 2024-05-18 13:48:24 -04:00 committed by GitHub
parent a51331c4b7
commit 6ce4f96c85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,7 +109,7 @@ def _get_arguments_inner(x: Any, /) -> ast.arguments | None:
return None
def get_default_value(lines: list[str], position: ast.AST) -> str | None:
def get_default_value(lines: list[str], position: ast.expr) -> str | None:
try:
if position.lineno == position.end_lineno:
line = lines[position.lineno - 1]