Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion asyncer/_compat.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# AnyIO 4.1.0 renamed cancellable to abandon_on_cancel
import importlib
import importlib.metadata
import sys
from typing import Callable, TypeVar, Union

import anyio
import anyio.to_thread
from anyio import CapacityLimiter
from typing_extensions import TypeVarTuple, Unpack

if sys.version_info >= (3, 11):
from typing import TypeVarTuple, Unpack
else:
from typing_extensions import TypeVarTuple, Unpack

ANYIO_VERSION = importlib.metadata.version("anyio")

Expand Down
2 changes: 1 addition & 1 deletion asyncer/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def do_work(name: str) -> str:
async with asyncer.create_task_group() as task_group:
result1 = task_group.soonify(do_work)(name="task 1")
result2 = task_group.soonify(do_work)(name="task 2")
await anyio.sleep(0)
await anyio.lowlevel.checkpoint()
if not result1.pending:
print(result1.value)
if not result2.pending:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [
]
dependencies = [
"anyio >=3.4.0,<5.0",
"typing_extensions >=4.8.0; python_version < '3.10'"
"typing_extensions >=4.8.0; python_version < '3.11'"
]

[project.urls]
Expand Down