Skip to content

Commit

Permalink
fix: correct exceptions string format
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanaasagi committed Sep 17, 2019
1 parent 58bfa07 commit 725ad2e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES/4068.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
correct some exception string format
9 changes: 6 additions & 3 deletions aiohttp/http_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,12 @@ def _feed_data(self, data: bytes) -> Tuple[bool, bytes]:
left = len(self._decompressobj.unconsumed_tail)
raise WebSocketError(
WSCloseCode.MESSAGE_TOO_BIG,
"Decompressed message size exceeds limit {}".
format(self._max_msg_size + left,
self._max_msg_size))
"Decompressed message size {} exceeds limit {}"
.format(
self._max_msg_size + left,
self._max_msg_size
)
)
else:
payload_merged = bytes(self._partial)

Expand Down
2 changes: 1 addition & 1 deletion aiohttp/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __init__(self,
*args: Any,
**kwargs: Any) -> None:
if not isinstance(value, (bytes, bytearray, memoryview)):
raise TypeError("value argument must be byte-ish, not (!r)"
raise TypeError("value argument must be byte-ish, not {!r}"
.format(type(value)))

if 'content_type' not in kwargs:
Expand Down

0 comments on commit 725ad2e

Please sign in to comment.