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

Fix Python 3.11 error #1490

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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