Fix close an already reset connection

This commit is contained in:
NIC619 2019-12-24 16:19:49 +08:00
parent c35cb8318a
commit 8f52315816
No known key found for this signature in database
GPG Key ID: 570C35F5C2D51B17

View File

@ -55,4 +55,8 @@ class RawConnection(IRawConnection):
self.writer.close()
if sys.version_info < (3, 7):
return
await self.writer.wait_closed()
try:
await self.writer.wait_closed()
# In case the connection is already reset.
except (ConnectionResetError, RawConnError):
return