mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Change default value of read()
From `n = -1` to `n = None`, to comply with trio API
This commit is contained in:
@ -20,7 +20,7 @@ class RawConnection(IRawConnection):
|
||||
except IOException as error:
|
||||
raise RawConnError(error)
|
||||
|
||||
async def read(self, n: int = -1) -> bytes:
|
||||
async def read(self, n: int = None) -> bytes:
|
||||
"""
|
||||
Read up to ``n`` bytes from the underlying stream. This call is
|
||||
delegated directly to the underlying ``self.reader``.
|
||||
|
||||
@ -37,7 +37,7 @@ class NetStream(INetStream):
|
||||
"""
|
||||
self.protocol_id = protocol_id
|
||||
|
||||
async def read(self, n: int = -1) -> bytes:
|
||||
async def read(self, n: int = None) -> bytes:
|
||||
"""
|
||||
reads from stream.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user