diff --git a/pyproject.toml b/pyproject.toml index 84765ac..1ae2a4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ dependencies = [ "psutil", "numpy>=1.21", + "typing-extensions;python_version<'3.10'", ] dynamic = ["version"] @@ -82,7 +83,6 @@ select = [ "E", # pycodestyle "EM", # flake8-errmsg "F", # pyflakes - "FURB", "G", # flake8-logging-format "I", # isort "ISC", # flake8-implicit-str-concat diff --git a/src/pycanape/utils.py b/src/pycanape/utils.py index 8196efa..253cda1 100644 --- a/src/pycanape/utils.py +++ b/src/pycanape/utils.py @@ -4,14 +4,21 @@ import ctypes import logging +import sys import winreg from collections.abc import Callable from ctypes.util import find_library from threading import Lock -from typing import Any, ParamSpec, TypeVar +from typing import Any, TypeVar import psutil +if sys.version_info >= (3, 10): + from typing import ParamSpec +else: + from typing_extensions import ParamSpec + + LOG = logging.getLogger(__name__) LOCK = Lock()