diff --git a/asyncer/_compat.py b/asyncer/_compat.py index ade175e..687e962 100644 --- a/asyncer/_compat.py +++ b/asyncer/_compat.py @@ -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") diff --git a/asyncer/_main.py b/asyncer/_main.py index 78117e4..19d8318 100644 --- a/asyncer/_main.py +++ b/asyncer/_main.py @@ -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: diff --git a/poetry.toml b/poetry.toml deleted file mode 100644 index 084377a..0000000 --- a/poetry.toml +++ /dev/null @@ -1,2 +0,0 @@ -[virtualenvs] -create = false diff --git a/pyproject.toml b/pyproject.toml index 3497d51..82f6d79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,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]