diff --git a/redis/asyncio/connection.py b/redis/asyncio/connection.py index 0c7ce4511b..62eb7503f0 100644 --- a/redis/asyncio/connection.py +++ b/redis/asyncio/connection.py @@ -491,8 +491,6 @@ async def read_from_socket( # data was read from the socket and added to the buffer. # return True to indicate that data was read. return True - except asyncio.CancelledError: - raise except (socket.timeout, asyncio.TimeoutError): if raise_on_timeout: raise TimeoutError("Timeout reading from socket") from None diff --git a/tests/test_asyncio/test_pubsub.py b/tests/test_asyncio/test_pubsub.py index 7f7d19010e..555cfdbc77 100644 --- a/tests/test_asyncio/test_pubsub.py +++ b/tests/test_asyncio/test_pubsub.py @@ -917,7 +917,7 @@ async def loop_step_listen(self): except asyncio.TimeoutError: return False - + @pytest.mark.onlynoncluster class TestBaseException: @pytest.mark.skipif(