From 8699568d43c298b02401062150e3d48226961040 Mon Sep 17 00:00:00 2001 From: Kevin Mai-Husan Chia Date: Fri, 16 Aug 2019 10:08:39 +0800 Subject: [PATCH] Update libp2p/stream_muxer/mplex/mplex_stream.py Co-Authored-By: Alex Stokes --- libp2p/stream_muxer/mplex/mplex_stream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/stream_muxer/mplex/mplex_stream.py b/libp2p/stream_muxer/mplex/mplex_stream.py index 112e2b4..1d1d7a6 100644 --- a/libp2p/stream_muxer/mplex/mplex_stream.py +++ b/libp2p/stream_muxer/mplex/mplex_stream.py @@ -47,7 +47,7 @@ class MplexStream(IMuxedStream): :return: bytes actually read """ if n < 0 and n != -1: - raise ValueError("`n` can only be -1 if it is negative") + raise ValueError(f"the number of bytes to read ``n`` must be positive or -1 to indicate read until EOF") # If the buffer is empty at first, blocking wait for data. if len(self._buf) == 0: self._buf.extend(await self.mplex_conn.read_buffer(self.stream_id))