From 629da5ebcced14c3769ea623319dacf21ef8b131 Mon Sep 17 00:00:00 2001 From: shane Date: Tue, 22 Oct 2024 15:39:00 +0900 Subject: [PATCH] :art: :wrench: fix flake8/black > change type() check method from using type to using isinstance() --- zappa/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zappa/middleware.py b/zappa/middleware.py index 2f7bb2bfe..be6e03637 100644 --- a/zappa/middleware.py +++ b/zappa/middleware.py @@ -47,12 +47,12 @@ def encode_response(status, headers, exc_info=None): new_headers = [ header for header in headers - if ((type(header[0]) != str) or (header[0].lower() != "set-cookie")) + if isinstance(header[0], str) or header[0].lower() != "set-cookie" ] cookie_headers = [ (header[0].lower(), header[1]) for header in headers - if ((type(header[0]) == str) and (header[0].lower() == "set-cookie")) + if isinstance(header[0], str) and header[0].lower() == "set-cookie" ] new_headers = new_headers + cookie_headers