Skip to content

Commit 2c4c842

Browse files
Don't depend on async-timeout for Python 3.11+. (#30)
This library was upstreamed into the standard library and is thus deprecated.
1 parent dcf794c commit 2c4c842

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

hole/v5.py

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

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

1015
from . import exceptions
1116

hole/v6.py

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

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

1318
from . import exceptions
1419

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)