Merge pull request #323 from mhchia/fix/ignore-typing-for-wait

Ignore typing for `asyncio.wait`
This commit is contained in:
Kevin Mai-Husan Chia 2019-10-02 16:16:01 +08:00 committed by GitHub
commit a369a9f605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -257,6 +257,8 @@ class Swarm(INetwork):
# TODO: Should be changed to close multisple connections,
# if we have several connections per peer in the future.
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()
logger.debug("successfully close the connection to peer %s", peer_id)

View File

@ -62,7 +62,11 @@ class MplexStream(IMuxedStream):
self.event_remote_closed.wait()
)
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,
)
for fut in pending: