Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Fix Python 3.11 error
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Feb 6, 2023
1 parent 19be499 commit 1b95150
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES/1490.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aioredis.TimeoutError inherits only builtins.TimeoutError when Python asyncio.TimeoutError == builtins.TimeoutError.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Ivan Antonyuck
James Hilliard
Jan Špaček
Jeff Moser
Jeong, YunWon <youknowone>
Joongi Kim <achimnol>
Kyrylo Dehtyarenko
Leonid Shvechikov
Expand Down
9 changes: 6 additions & 3 deletions aioredis/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ class RedisError(Exception):
class ConnectionError(RedisError):
pass


class TimeoutError(asyncio.TimeoutError, builtins.TimeoutError, RedisError):
pass
if asyncio.TimeoutError is builtins.TimeoutError: # >= Python 3.11
class TimeoutError(builtins.TimeoutError, RedisError):
pass
else:
class TimeoutError(asyncio.TimeoutError, builtins.TimeoutError, RedisError):
pass


class AuthenticationError(ConnectionError):
Expand Down

0 comments on commit 1b95150

Please sign in to comment.