Update _compat.py

Fix _compat.is_uploadfile_sequence_annotation
This commit is contained in:
rigens 2023-10-06 13:25:05 +03:00 committed by GitHub
parent c1adce4fe9
commit 52a483704a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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
)