File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
# AnyIO 4.1.0 renamed cancellable to abandon_on_cancel
2
2
import importlib
3
3
import importlib .metadata
4
+ import sys
4
5
from typing import Callable , TypeVar , Union
5
6
6
7
import anyio
7
8
import anyio .to_thread
8
9
from anyio import CapacityLimiter
9
- from typing_extensions import TypeVarTuple , Unpack
10
+
11
+ if sys .version_info >= (3 , 11 ):
12
+ from typing import TypeVarTuple , Unpack
13
+ else :
14
+ from typing_extensions import TypeVarTuple , Unpack
10
15
11
16
ANYIO_VERSION = importlib .metadata .version ("anyio" )
12
17
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ async def do_work(name: str) -> str:
135
135
async with asyncer.create_task_group() as task_group:
136
136
result1 = task_group.soonify(do_work)(name="task 1")
137
137
result2 = task_group.soonify(do_work)(name="task 2")
138
- await anyio.sleep(0 )
138
+ await anyio.lowlevel.checkpoint( )
139
139
if not result1.pending:
140
140
print(result1.value)
141
141
if not result2.pending:
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ classifiers = [
32
32
]
33
33
dependencies = [
34
34
" anyio >=3.4.0,<5.0" ,
35
- " typing_extensions >=4.8.0; python_version < '3.10 '"
35
+ " typing_extensions >=4.8.0; python_version < '3.11 '"
36
36
]
37
37
38
38
[project .urls ]
You can’t perform that action at this time.
0 commit comments