Skip to content

Commit

Permalink
[3.6] fix: correct exceptions string format (#4068)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d88cb0)

Co-authored-by: 秋葉 <ambiguous404@gmail.com>
  • Loading branch information
Hanaasagi authored and asvetlov committed Sep 17, 2019
1 parent 3e0691c commit 7169e65
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 @@ -365,9 +365,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 7169e65

Please sign in to comment.