From 2d56d7521c9f65529730a32647f1632d1d6c2606 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Mon, 6 Feb 2023 08:56:28 +0900 Subject: [PATCH] Fix Python 3.11 error --- aioredis/exceptions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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):