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):