Skip to content

Commit 8dcff08

Browse files
committed
Simplify comment.
1 parent f3bf803 commit 8dcff08

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/websockets/utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ def apply_mask(data: BytesLike, mask: bytes | bytearray) -> bytes:
4747
if len(mask) != 4:
4848
raise ValueError("mask must contain 4 bytes")
4949

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.
50+
# Python 3.15+ requires C-contiguous buffers for int.from_bytes().
5551
if isinstance(data, memoryview) and not data.c_contiguous:
5652
data = bytes(data)
5753

0 commit comments

Comments
 (0)