From 52a483704a7620b744788d7c61cd7b0c0945aff7 Mon Sep 17 00:00:00 2001 From: rigens <68144278+rigens@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:25:05 +0300 Subject: [PATCH] Update _compat.py Fix _compat.is_uploadfile_sequence_annotation --- fastapi/_compat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fastapi/_compat.py b/fastapi/_compat.py index a4b305d42..df7541316 100644 --- a/fastapi/_compat.py +++ b/fastapi/_compat.py @@ -623,7 +623,8 @@ def is_uploadfile_sequence_annotation(annotation: Any) -> bool: at_least_one = True continue return at_least_one - return field_annotation_is_sequence(annotation) and all( + args = get_args(annotation) + return field_annotation_is_sequence(annotation) and args and all( is_uploadfile_or_nonable_uploadfile_annotation(sub_annotation) - for sub_annotation in get_args(annotation) + for sub_annotation in args )