Browse Source

fix Python version check

Signed-off-by: merlinz01 <[email protected]>
pull/12135/head
merlinz01 2 years ago
parent
commit
150d080a51
  1. 4
      fastapi/dependencies/utils.py

4
fastapi/dependencies/utils.py

@ -735,7 +735,7 @@ async def solve_dependencies(
if PYDANTIC_V2: if PYDANTIC_V2:
if sys.hexversion >= 0x30A00000: if sys.hexversion >= 0x30A0000:
def _allows_none(field: ModelField) -> bool: def _allows_none(field: ModelField) -> bool:
origin = get_origin(field.type_) origin = get_origin(field.type_)
@ -750,7 +750,7 @@ if PYDANTIC_V2:
else: else:
def _allows_none(field: ModelField) -> bool: def _allows_none(field: ModelField) -> bool:
return field.allow_none return field.allow_none # type: ignore
def _validate_value_with_model_field( def _validate_value_with_model_field(

Loading…
Cancel
Save