From 83bd23970e5ccd8f40be7325d56cbf140e252367 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:17:16 +0000 Subject: [PATCH] [PR #8747/e97b17a6 backport][3.10] Make MESSAGE_TYPES_WITH_CONTENT a frozenset for the WebSocketReader (#8750) Co-authored-by: J. Nick Koston --- CHANGES/8747.misc.rst | 1 + aiohttp/http_websocket.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 120000 CHANGES/8747.misc.rst diff --git a/CHANGES/8747.misc.rst b/CHANGES/8747.misc.rst new file mode 120000 index 00000000000..9eb648d0e2b --- /dev/null +++ b/CHANGES/8747.misc.rst @@ -0,0 +1 @@ +8736.misc.rst \ No newline at end of file diff --git a/aiohttp/http_websocket.py b/aiohttp/http_websocket.py index ab1af44da7b..db0cb429d83 100644 --- a/aiohttp/http_websocket.py +++ b/aiohttp/http_websocket.py @@ -94,10 +94,12 @@ class WSMsgType(IntEnum): error = ERROR -MESSAGE_TYPES_WITH_CONTENT: Final = ( - WSMsgType.BINARY, - WSMsgType.TEXT, - WSMsgType.CONTINUATION, +MESSAGE_TYPES_WITH_CONTENT: Final = frozenset( + { + WSMsgType.BINARY, + WSMsgType.TEXT, + WSMsgType.CONTINUATION, + } ) WS_KEY: Final[bytes] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"