diff --git a/asyncer/_compat.py b/asyncer/_compat.py index ade175e8..687e9628 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/pyproject.toml b/pyproject.toml index e3fd80bb..18d19f3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]