Remove self._loop references.

This commit is contained in:
Yuxin Wang 2018-10-10 19:42:54 -04:00
parent 526ac4c083
commit 5fd2b1e95d

View file

@ -156,7 +156,7 @@ class Peer(MessageServer):
# connect to all peers and do a speed test
for peer_address in chunkinfo.keys():
# peer_address is a string, since JSON requires keys being strings
peers[peer_address] = await asyncio.open_connection(*json.loads(peer_address), loop=self._loop)
peers[peer_address] = await asyncio.open_connection(*json.loads(peer_address))
peer_rtts = await self._test_peer_rtt(peers)
@ -281,7 +281,7 @@ class Peer(MessageServer):
# if new peer appeared in chunkinfo
if address not in peers:
reader, writer = \
await asyncio.open_connection(*json.loads(peer_address), loop=self._loop)
await asyncio.open_connection(*json.loads(peer_address))
peers[address] = reader, writer
peer_rtts[address] = await self._test_peer_rtt((address, reader, writer))
# schedule the read tasks to wait for