From bfe999ac9e8c25b609a1490d591411c665424c1b Mon Sep 17 00:00:00 2001 From: Charles Pigott <charlespigott@googlemail.com> Date: Tue, 12 Sep 2023 19:37:10 +0100 Subject: [PATCH] Codechange: Use flake8 recommended way of doing type comparisons (#417) --- bananas_api/new_upload/session_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bananas_api/new_upload/session_validation.py b/bananas_api/new_upload/session_validation.py index be517df..42a3578 100644 --- a/bananas_api/new_upload/session_validation.py +++ b/bananas_api/new_upload/session_validation.py @@ -111,9 +111,9 @@ def validate_packet_size(session, package): size += 1 for key, value in Classification().dump(session.get("classification")).items(): size += len(key) + 2 - if type(value) == str: + if type(value) is str: size += len(value) + 2 - elif type(value) == bool: + elif type(value) is bool: size += len("yes") + 2 else: raise ValueError("Unknown type for classification value")