Skip to content

Commit

Permalink
Standardize spelling of canceling/canceled.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Jan 29, 2025
1 parent a00c184 commit 7bb226a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/project/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Bug fixes
:mod:`threading` implementation. If a message is already received, it is
returned. Previously, :exc:`TimeoutError` was raised incorrectly.

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

* Prevented :meth:`~asyncio.connection.Connection.close` from blocking when
Expand Down
4 changes: 2 additions & 2 deletions src/websockets/asyncio/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def get(self, decode: bool | None = None) -> Data:
self.get_in_progress = True

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

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

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

# If get_iter() raises an exception e.g. in decoder.decode(),
# get_in_progress remains set and the connection becomes unusable.
Expand Down
8 changes: 4 additions & 4 deletions tests/asyncio/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ async def test_recv_during_recv_streaming(self):
)

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

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

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

Expand Down Expand Up @@ -386,7 +386,7 @@ async def test_recv_streaming_during_recv_streaming(self):
)

async def test_recv_streaming_cancellation_before_receiving(self):
"""recv_streaming can be cancelled before receiving a frame."""
"""recv_streaming can be canceled before receiving a frame."""
recv_streaming_task = asyncio.create_task(
alist(self.connection.recv_streaming())
)
Expand All @@ -403,7 +403,7 @@ async def test_recv_streaming_cancellation_before_receiving(self):
)

async def test_recv_streaming_cancellation_while_receiving(self):
"""recv_streaming cannot be cancelled after receiving a frame."""
"""recv_streaming cannot be canceled after receiving a frame."""
recv_streaming_task = asyncio.create_task(
alist(self.connection.recv_streaming())
)
Expand Down

0 comments on commit 7bb226a

Please sign in to comment.