Fix mypy error

This commit is contained in:
NIC619 2019-10-18 15:59:35 +08:00
parent 9889cb8ab1
commit d52b093286
No known key found for this signature in database
GPG Key ID: 570C35F5C2D51B17
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ class MplexStream(IMuxedStream):
:return: number of bytes written
"""
if self.event_local_closed.is_set():
raise MplexStreamClosed(f"cannot write to closed stream: data={data}")
raise MplexStreamClosed(f"cannot write to closed stream: data={data!r}")
flag = (
HeaderTags.MessageInitiator
if self.is_initiator

View File

@ -77,7 +77,7 @@ async def read_delim(reader: Reader) -> bytes:
raise ParseError(f"`len(msg_bytes)` should not be 0")
if msg_bytes[-1:] != b"\n":
raise ParseError(
f'`msg_bytes` is not delimited by b"\\n": `msg_bytes`={msg_bytes}'
f'`msg_bytes` is not delimited by b"\\n": `msg_bytes`={msg_bytes!r}'
)
return msg_bytes[:-1]