Merge pull request #323 from mhchia/fix/ignore-typing-for-wait
Ignore typing for `asyncio.wait`
This commit is contained in:
commit
a369a9f605
|
@ -257,6 +257,8 @@ class Swarm(INetwork):
|
||||||
# TODO: Should be changed to close multisple connections,
|
# TODO: Should be changed to close multisple connections,
|
||||||
# if we have several connections per peer in the future.
|
# if we have several connections per peer in the future.
|
||||||
connection = self.connections[peer_id]
|
connection = self.connections[peer_id]
|
||||||
|
# NOTE: `connection.close` performs `del self.connections[peer_id]` for us,
|
||||||
|
# so we don't need to remove the entry here.
|
||||||
await connection.close()
|
await connection.close()
|
||||||
|
|
||||||
logger.debug("successfully close the connection to peer %s", peer_id)
|
logger.debug("successfully close the connection to peer %s", peer_id)
|
||||||
|
|
|
@ -62,7 +62,11 @@ class MplexStream(IMuxedStream):
|
||||||
self.event_remote_closed.wait()
|
self.event_remote_closed.wait()
|
||||||
)
|
)
|
||||||
done, pending = await asyncio.wait( # type: ignore
|
done, pending = await asyncio.wait( # type: ignore
|
||||||
[task_event_reset, task_incoming_data_get, task_event_remote_closed],
|
[ # type: ignore
|
||||||
|
task_event_reset,
|
||||||
|
task_incoming_data_get,
|
||||||
|
task_event_remote_closed,
|
||||||
|
],
|
||||||
return_when=asyncio.FIRST_COMPLETED,
|
return_when=asyncio.FIRST_COMPLETED,
|
||||||
)
|
)
|
||||||
for fut in pending:
|
for fut in pending:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user