Skip to content

Commit

Permalink
re-add CancelledError exception handler case
Browse files Browse the repository at this point in the history
This error is an Exception (not BaseException) in 3.7 and earlier.
  • Loading branch information
kristjanvalur committed Jun 24, 2022
1 parent 8a9cc1f commit f7a7498
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions redis/asyncio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ async def connect(self):
return
try:
await self._connect()
except asyncio.CancelledError:
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 f7a7498

Please sign in to comment.