From 0cc17ea322ef293662b6aaccadc6ef734b941ed9 Mon Sep 17 00:00:00 2001 From: Sanster Date: Sun, 27 Mar 2022 13:20:56 +0800 Subject: [PATCH] remove redundant parentheses --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 0ede27b..0716a32 100644 --- a/main.py +++ b/main.py @@ -103,8 +103,8 @@ def index(): def set_input_photo(): if input_image: input_file = os.path.join(os.path.dirname(__file__), input_image) - if (os.path.exists(input_file)): # Check if file exists - if (imghdr.what(input_file) is not None): # Check if file is image + if os.path.exists(input_file): # Check if file exists + if imghdr.what(input_file) is not None: # Check if file is image with open(input_file, 'rb') as f: image_in_bytes = f.read() return send_file(io.BytesIO(image_in_bytes), mimetype='image/jpeg')