From 6e0fdcbfb986a0cce0090ffeb55333cdb277eb86 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 27 Oct 2024 08:33:21 -1000 Subject: [PATCH] Revert "namespace cleanups" This reverts commit b74b874255e45b44a93b8e5df1f5405a281936fc. --- aiohttp/_websocket/helpers.py | 10 +++++----- aiohttp/_websocket/mask.pyx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aiohttp/_websocket/helpers.py b/aiohttp/_websocket/helpers.py index 022b2b7cb92..41273dd3230 100644 --- a/aiohttp/_websocket/helpers.py +++ b/aiohttp/_websocket/helpers.py @@ -28,7 +28,7 @@ def _xor_table() -> List[bytes]: return [bytes(a ^ b for a in range(256)) for b in range(256)] -def _mask_python(mask: bytes, data: bytearray) -> None: +def _websocket_mask_python(mask: bytes, data: bytearray) -> None: """Websocket masking function. `mask` is a `bytes` object of length 4; `data` is a `bytearray` @@ -54,14 +54,14 @@ def _mask_python(mask: bytes, data: bytearray) -> None: if TYPE_CHECKING or NO_EXTENSIONS: # pragma: no cover - websocket_mask = _mask_python + websocket_mask = _websocket_mask_python else: try: - from .mask import _mask_cython # type: ignore[import-not-found] + from ._websocket import _websocket_mask_cython # type: ignore[import-not-found] - websocket_mask = _mask_cython + websocket_mask = _websocket_mask_cython except ImportError: # pragma: no cover - websocket_mask = _mask_python + websocket_mask = _websocket_mask_python _WS_EXT_RE: Final[Pattern[str]] = re.compile( diff --git a/aiohttp/_websocket/mask.pyx b/aiohttp/_websocket/mask.pyx index 355fc7a4dbf..94318d2b1be 100644 --- a/aiohttp/_websocket/mask.pyx +++ b/aiohttp/_websocket/mask.pyx @@ -8,7 +8,7 @@ cdef extern from "Python.h": from libc.stdint cimport uint32_t, uint64_t, uintmax_t -def _mask_cython(object mask, object data): +def _websocket_mask_cython(object mask, object data): """Note, this function mutates its `data` argument """ cdef: