We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3bf803 commit 8dcff08Copy full SHA for 8dcff08
1 file changed
src/websockets/utils.py
@@ -47,11 +47,7 @@ def apply_mask(data: BytesLike, mask: bytes | bytearray) -> bytes:
47
if len(mask) != 4:
48
raise ValueError("mask must contain 4 bytes")
49
50
- # Python 3.15+ requires C-contiguous buffers for int.from_bytes()
51
- # CPython (https://github.com/python/cpython/pull/132109) optimized
52
- # int.from_bytes() to use the buffer protocol with PyBUF_SIMPLE, which requires
53
- # C-contiguous buffers. Non-contiguous memoryviews (e.g., created by [::-1])
54
- # now raise BufferError. Convert to bytes to create a contiguous copy.
+ # Python 3.15+ requires C-contiguous buffers for int.from_bytes().
55
if isinstance(data, memoryview) and not data.c_contiguous:
56
data = bytes(data)
57
0 commit comments