Skip to content

Commit

Permalink
Remove redundant checks for asyncio.CancelledError
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Jul 9, 2022
1 parent 781388a commit c4f9e9f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions redis/asyncio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,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
Expand Down Expand Up @@ -708,7 +706,7 @@ async def connect(self):
try:
await self._connect()
except asyncio.CancelledError:
raise
raise # in 3.7 and earlier, this is an Exception, not BaseException
except (socket.timeout, asyncio.TimeoutError):
raise TimeoutError("Timeout connecting to server")
except OSError as e:
Expand Down

0 comments on commit c4f9e9f

Please sign in to comment.