mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Fixes to add python 3.6 compatibility
This commit is contained in:
@ -151,7 +151,8 @@ class DaemonStream(ReadWriteCloser):
|
||||
|
||||
async def close(self) -> None:
|
||||
self.writer.close()
|
||||
await self.writer.wait_closed()
|
||||
if sys.version_info[0:2] > (3, 6):
|
||||
await self.writer.wait_closed()
|
||||
|
||||
async def read(self, n: int = -1) -> bytes:
|
||||
return await self.reader.read(n)
|
||||
@ -196,7 +197,8 @@ async def py_to_daemon_stream_pair(hosts, p2pds, is_to_fail_daemon_stream):
|
||||
# some day.
|
||||
listener = p2pds[0].control.control.listener
|
||||
listener.close()
|
||||
await listener.wait_closed()
|
||||
if sys.version_info[0:2] > (3, 6):
|
||||
await listener.wait_closed()
|
||||
stream_py = await host.new_stream(p2pd.peer_id, [protocol_id])
|
||||
if not is_to_fail_daemon_stream:
|
||||
await event_stream_handled.wait()
|
||||
|
||||
Reference in New Issue
Block a user