Skip to content

Commit 7bb226a

Browse files
committed
Standardize spelling of canceling/canceled.
1 parent a00c184 commit 7bb226a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/project/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Bug fixes
8484
:mod:`threading` implementation. If a message is already received, it is
8585
returned. Previously, :exc:`TimeoutError` was raised incorrectly.
8686

87-
* Fixed a crash in the :mod:`asyncio` implementation when cancelling a ping
87+
* Fixed a crash in the :mod:`asyncio` implementation when canceling a ping
8888
then receiving the corresponding pong.
8989

9090
* Prevented :meth:`~asyncio.connection.Connection.close` from blocking when

src/websockets/asyncio/messages.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async def get(self, decode: bool | None = None) -> Data:
152152
self.get_in_progress = True
153153

154154
# Locking with get_in_progress prevents concurrent execution
155-
# until get() fetches a complete message or is cancelled.
155+
# until get() fetches a complete message or is canceled.
156156

157157
try:
158158
# First frame
@@ -224,7 +224,7 @@ async def get_iter(self, decode: bool | None = None) -> AsyncIterator[Data]:
224224
self.get_in_progress = True
225225

226226
# Locking with get_in_progress prevents concurrent execution
227-
# until get_iter() fetches a complete message or is cancelled.
227+
# until get_iter() fetches a complete message or is canceled.
228228

229229
# If get_iter() raises an exception e.g. in decoder.decode(),
230230
# get_in_progress remains set and the connection becomes unusable.

tests/asyncio/test_connection.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ async def test_recv_during_recv_streaming(self):
245245
)
246246

247247
async def test_recv_cancellation_before_receiving(self):
248-
"""recv can be cancelled before receiving a frame."""
248+
"""recv can be canceled before receiving a frame."""
249249
recv_task = asyncio.create_task(self.connection.recv())
250250
await asyncio.sleep(0) # let the event loop start recv_task
251251

@@ -257,7 +257,7 @@ async def test_recv_cancellation_before_receiving(self):
257257
self.assertEqual(await self.connection.recv(), "😀")
258258

259259
async def test_recv_cancellation_while_receiving(self):
260-
"""recv cannot be cancelled after receiving a frame."""
260+
"""recv cannot be canceled after receiving a frame."""
261261
recv_task = asyncio.create_task(self.connection.recv())
262262
await asyncio.sleep(0) # let the event loop start recv_task
263263

@@ -386,7 +386,7 @@ async def test_recv_streaming_during_recv_streaming(self):
386386
)
387387

388388
async def test_recv_streaming_cancellation_before_receiving(self):
389-
"""recv_streaming can be cancelled before receiving a frame."""
389+
"""recv_streaming can be canceled before receiving a frame."""
390390
recv_streaming_task = asyncio.create_task(
391391
alist(self.connection.recv_streaming())
392392
)
@@ -403,7 +403,7 @@ async def test_recv_streaming_cancellation_before_receiving(self):
403403
)
404404

405405
async def test_recv_streaming_cancellation_while_receiving(self):
406-
"""recv_streaming cannot be cancelled after receiving a frame."""
406+
"""recv_streaming cannot be canceled after receiving a frame."""
407407
recv_streaming_task = asyncio.create_task(
408408
alist(self.connection.recv_streaming())
409409
)

0 commit comments

Comments
 (0)