From d8d5e738e22ee1577eb9c9662c566976c8a618d6 Mon Sep 17 00:00:00 2001 From: iap Date: Wed, 10 Sep 2025 10:19:01 -0400 Subject: [PATCH] small fix in get_default_function_sig do not crash in the case or when a function arg has both a default value and a non-string type annotation --- mypy/stubgenc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/stubgenc.py b/mypy/stubgenc.py index e64dbcdd9d40..e0e063927aad 100755 --- a/mypy/stubgenc.py +++ b/mypy/stubgenc.py @@ -322,7 +322,7 @@ def add_args( default_value = get_default_value(i, arg) if default_value is not _Missing.VALUE: if arg in annotations: - argtype = annotations[arg] + argtype = get_annotation(arg) else: argtype = self.get_type_annotation(default_value) if argtype == "None":