From cb1c40a9d21eeb84b092a048a550d4d4c54b7fbb Mon Sep 17 00:00:00 2001 From: rigens <68144278+rigens@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:19:55 +0300 Subject: [PATCH] Fix mypy issue --- fastapi/_compat.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fastapi/_compat.py b/fastapi/_compat.py index a2eeee91a..3f882ca3f 100644 --- a/fastapi/_compat.py +++ b/fastapi/_compat.py @@ -613,7 +613,6 @@ 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: @@ -624,11 +623,7 @@ def is_uploadfile_sequence_annotation(annotation: Any) -> bool: continue return at_least_one 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 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 )