Skip to content

Commit

Permalink
Revert "namespace cleanups"
Browse files Browse the repository at this point in the history
This reverts commit b74b874.
  • Loading branch information
bdraco committed Oct 27, 2024
1 parent b74b874 commit 6e0fdcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions aiohttp/_websocket/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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

Check warning on line 62 in aiohttp/_websocket/helpers.py

View check run for this annotation

Codecov / codecov/patch

aiohttp/_websocket/helpers.py#L62

Added line #L62 was not covered by tests
except ImportError: # pragma: no cover
websocket_mask = _mask_python
websocket_mask = _websocket_mask_python


_WS_EXT_RE: Final[Pattern[str]] = re.compile(
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/_websocket/mask.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6e0fdcb

Please sign in to comment.