PR feedback

- Use f-string
- Fix wrongly indented comments
- Add dep `trio-typing`
pull/365/head
mhchia 2020-01-28 15:48:41 +08:00
parent 095a848f30
commit e57d01f360
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A
3 changed files with 3 additions and 2 deletions

View File

@ -63,7 +63,7 @@ async def run(port: int, destination: str) -> None:
nursery.start_soon(read_data, stream)
nursery.start_soon(write_data, stream)
print("Connected to peer %s" % info.addrs[0])
print(f"Connected to peer {info.addrs[0]}")
await trio.sleep_forever()

View File

@ -60,9 +60,9 @@ class SwarmConn(INetConn):
while True:
try:
stream = await self.muxed_conn.accept_stream()
# Asynchronously handle the accepted stream, to avoid blocking the next stream.
except MuxedConnUnavailable:
break
# Asynchronously handle the accepted stream, to avoid blocking the next stream.
self.swarm.manager.run_task(self._handle_muxed_stream, stream)
await self.close()

View File

@ -77,6 +77,7 @@ install_requires = [
"trio>=0.13.0",
"async-service>=0.1.0a4",
"async-exit-stack==1.0.1",
"trio-typing>=0.3.0,<1.0.0",
]