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

Commit 1b95150

Browse files
committed
Fix Python 3.11 error
1 parent 19be499 commit 1b95150

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGES/1490.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aioredis.TimeoutError inherits only builtins.TimeoutError when Python asyncio.TimeoutError == builtins.TimeoutError.

CONTRIBUTORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Ivan Antonyuck
3737
James Hilliard
3838
Jan Špaček
3939
Jeff Moser
40+
Jeong, YunWon <youknowone>
4041
Joongi Kim <achimnol>
4142
Kyrylo Dehtyarenko
4243
Leonid Shvechikov

aioredis/exceptions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ class RedisError(Exception):
1010
class ConnectionError(RedisError):
1111
pass
1212

13-
14-
class TimeoutError(asyncio.TimeoutError, builtins.TimeoutError, RedisError):
15-
pass
13+
if asyncio.TimeoutError is builtins.TimeoutError: # >= Python 3.11
14+
class TimeoutError(builtins.TimeoutError, RedisError):
15+
pass
16+
else:
17+
class TimeoutError(asyncio.TimeoutError, builtins.TimeoutError, RedisError):
18+
pass
1619

1720

1821
class AuthenticationError(ConnectionError):

0 commit comments

Comments
 (0)