Skip to content

Commit

Permalink
Fix refactoring error from moving WebSocket mask (#9558)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 28, 2024
1 parent 50656ca commit 0a70662
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/9558.feature.rst
2 changes: 1 addition & 1 deletion aiohttp/_websocket/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _websocket_mask_python(mask: bytes, data: bytearray) -> None:
websocket_mask = _websocket_mask_python
else:
try:
from ._websocket import _websocket_mask_cython # type: ignore[import-not-found]
from .mask import _websocket_mask_cython # type: ignore[import-not-found]

websocket_mask = _websocket_mask_cython
except ImportError: # pragma: no cover
Expand Down
3 changes: 3 additions & 0 deletions tests/test_websocket_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ def test_websocket_mask_cython() -> None:
message = bytearray(websocket_mask_data)
_websocket_helpers._websocket_mask_cython(websocket_mask_mask, message) # type: ignore[attr-defined]
assert message == websocket_mask_masked
assert (
_websocket_helpers.websocket_mask is _websocket_helpers._websocket_mask_cython # type: ignore[attr-defined]
)


def test_websocket_mask_python_empty() -> None:
Expand Down

0 comments on commit 0a70662

Please sign in to comment.