diff --git a/CHANGES/1490.bugfix b/CHANGES/1490.bugfix new file mode 100644 index 000000000..8c222a2f4 --- /dev/null +++ b/CHANGES/1490.bugfix @@ -0,0 +1 @@ +aioredis.TimeoutError inherits only builtins.TimeoutError when Python asyncio.TimeoutError == builtins.TimeoutError. diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 36953225a..37bbe5ed6 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -37,6 +37,7 @@ Ivan Antonyuck James Hilliard Jan Špaček Jeff Moser +Jeong, YunWon Joongi Kim Kyrylo Dehtyarenko Leonid Shvechikov diff --git a/aioredis/exceptions.py b/aioredis/exceptions.py index e4c2ed1e4..9cf3a3a3d 100644 --- a/aioredis/exceptions.py +++ b/aioredis/exceptions.py @@ -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):