From 4b6a363526487791e32993753b329c805f6c19d9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:20:29 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/_compat.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fastapi/_compat.py b/fastapi/_compat.py index 3f882ca3f..bdf2f234b 100644 --- a/fastapi/_compat.py +++ b/fastapi/_compat.py @@ -613,6 +613,7 @@ def is_bytes_sequence_annotation(annotation: Any) -> bool: for sub_annotation in get_args(annotation) ) + def is_uploadfile_sequence_annotation(annotation: Any) -> bool: origin = get_origin(annotation) if origin is Union or origin is UnionType: @@ -623,7 +624,11 @@ def is_uploadfile_sequence_annotation(annotation: Any) -> bool: continue return at_least_one args = get_args(annotation) - return field_annotation_is_sequence(annotation) and bool(args) and all( - is_uploadfile_or_nonable_uploadfile_annotation(sub_annotation) - for sub_annotation in args + return ( + field_annotation_is_sequence(annotation) + and bool(args) + and all( + is_uploadfile_or_nonable_uploadfile_annotation(sub_annotation) + for sub_annotation in args + ) )