From 1252ed2df506c63570594c7261157161992b7172 Mon Sep 17 00:00:00 2001 From: merlinz01 <158784988+merlinz01@users.noreply.github.com> Date: Thu, 5 Sep 2024 22:10:42 -0400 Subject: [PATCH] fix Python version check Signed-off-by: merlinz01 <158784988+merlinz01@users.noreply.github.com> --- fastapi/dependencies/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index 2f0b806ec..184f10613 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -734,7 +734,7 @@ async def solve_dependencies( if PYDANTIC_V2: - if sys.hexversion >= 0x30A00000: + if sys.hexversion >= 0x30A0000: def _allows_none(field: ModelField) -> bool: origin = get_origin(field.type_) @@ -749,7 +749,7 @@ if PYDANTIC_V2: else: def _allows_none(field: ModelField) -> bool: - return field.allow_none + return field.allow_none # type: ignore def _validate_value_with_model_field(