From 2a15fdb93ab136e5776692d620852f481c89d610 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 26 Mar 2026 23:45:38 +0100 Subject: [PATCH] Fix pylint isinstance-second-argument-not-valid-type warning --- gunicorn/asgi/protocol.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn/asgi/protocol.py b/gunicorn/asgi/protocol.py index 246fee6e..030c2c24 100644 --- a/gunicorn/asgi/protocol.py +++ b/gunicorn/asgi/protocol.py @@ -496,7 +496,8 @@ class ASGIProtocol(asyncio.Protocol): except Exception as e: # Handle gunicorn_h1c exceptions (different class hierarchy) h1c_exc = ASGIProtocol._h1c_invalid_chunk_extension - if h1c_exc and isinstance(e, h1c_exc): + # pylint: disable=isinstance-second-argument-not-valid-type + if h1c_exc is not None and isinstance(e, h1c_exc): self._send_error_response(400, str(e)) self._close_transport() return