Skip to content

Commit 8a4e309

Browse files
Don't depend on async-timeout for Python 3.11+.
This library was upstreamed into the standard library and is thus deprecated.
1 parent dcf794c commit 8a4e309

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

hole/v5.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
import socket
66

77
import aiohttp
8-
import async_timeout
8+
import sys
9+
if sys.version_info >= (3, 11):
10+
import asyncio as async_timeout
11+
else:
12+
import async_timeout
913

1014
from . import exceptions
1115

hole/v6.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
from typing import Optional, Literal
99

1010
import aiohttp
11-
import async_timeout
11+
import sys
12+
if sys.version_info >= (3, 11):
13+
import asyncio as async_timeout
14+
else:
15+
import async_timeout
1216

1317
from . import exceptions
1418

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
license="MIT",
2222
install_requires=[
2323
"aiohttp<4",
24-
"async_timeout>4,<5",
24+
"async_timeout; python_version < \"3.11\"",
2525
],
2626
packages=["hole"],
2727
python_requires=">=3.9",

0 commit comments

Comments
 (0)