fix return type of eval_type

This commit is contained in:
svlandeg 2026-03-13 10:18:40 +01:00
parent 97ce5de0bf
commit 8e5d327aca
1 changed files with 3 additions and 3 deletions

View File

@ -42,9 +42,9 @@ Undefined = PydanticUndefined
def define_forwardref() -> Callable[..., Any]:
# eval_type_lenient has been deprecated since Pydantic v2.10.0b1 (PR #10530)
eval_type = getattr(_pydantic_typing_extra, "try_eval_type", None)
if eval_type is not None:
return cast(Callable[..., Any], eval_type)
try_eval_type = getattr(_pydantic_typing_extra, "try_eval_type", None)
if try_eval_type is not None:
return lambda *args: try_eval_type(*args)[0]
return _pydantic_typing_extra.eval_type_lenient