Skip to content

Commit

Permalink
Fix typos in comments.
Browse files Browse the repository at this point in the history
Fix #1284.

Thank you @cclauss!
  • Loading branch information
aaugustin committed Feb 19, 2023
1 parent f2176eb commit a525950
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/websockets/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Frame:

def __str__(self) -> str:
"""
Return a human-readable represention of a frame.
Return a human-readable representation of a frame.
"""
coding = None
Expand Down Expand Up @@ -389,7 +389,7 @@ class Close:

def __str__(self) -> str:
"""
Return a human-readable represention of a close code and reason.
Return a human-readable representation of a close code and reason.
"""
if 3000 <= self.code < 4000:
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/legacy/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ async def read_data_frame(self, max_size: Optional[int]) -> Optional[Frame]:
try:
# Echo the original data instead of re-serializing it with
# Close.serialize() because that fails when the close frame
# is empty and Close.parse() synthetizes a 1005 close code.
# is empty and Close.parse() synthesizes a 1005 close code.
await self.write_close_frame(self.close_rcvd, frame.data)
except ConnectionClosed:
# Connection closed before we could echo the close frame.
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def recv_frame(self, frame: Frame) -> None:
if self.state is OPEN:
# Echo the original data instead of re-serializing it with
# Close.serialize() because that fails when the close frame
# is empty and Close.parse() synthetizes a 1005 close code.
# is empty and Close.parse() synthesizes a 1005 close code.
# The rest is identical to send_close().
self.send_frame(Frame(OP_CLOSE, frame.data))
self.close_sent = self.close_rcvd
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def reject(
response = Response(status.value, status.phrase, headers, body)
# When reject() is called from accept(), handshake_exc is already set.
# If a user calls reject(), set handshake_exc to guarantee invariant:
# "handshake_exc is None if and only if opening handshake succeded."
# "handshake_exc is None if and only if opening handshake succeeded."
if self.handshake_exc is None:
self.handshake_exc = InvalidStatus(response)
self.logger.info("connection failed (%d %s)", status.value, status.phrase)
Expand Down

0 comments on commit a525950

Please sign in to comment.