Don't catch trio.BusyResourceError

This commit is contained in:
mhchia 2020-01-26 23:09:56 +08:00
parent 5b4b65faa8
commit b85bab1a09
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A

View File

@ -35,12 +35,6 @@ class TrioTCPStream(ReadWriteCloser):
return await self.stream.receive_some(n)
except (trio.ClosedResourceError, trio.BrokenResourceError) as error:
raise IOException from error
except trio.BusyResourceError as error:
# This should never happen, since we already access streams with read/write locks.
raise Exception(
"this should never happen "
"since we already access streams with read/write locks."
) from error
async def close(self) -> None:
await self.stream.aclose()