Skip to content

Commit bf5e335

Browse files
committed
Remove types for __deprecated as ParamSpec not available on Py3.8
1 parent 7ec987e commit bf5e335

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bindings/python/unicorn/unicorn_py3/unicorn.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from __future__ import annotations
6-
from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Iterable, Iterator, Optional, Sequence, Tuple, Type, TypeVar, Union, ParamSpec
6+
from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Iterable, Iterator, Optional, Sequence, Tuple, Type, TypeVar, Union
77

88
import ctypes
99
import functools
@@ -636,14 +636,12 @@ class Uc(RegStateManager):
636636
# https://stackoverflow.com/questions/2536307/decorators-in-the-python-standard-lib-deprecated-specifically
637637
@staticmethod
638638
def __deprecated(msg: str):
639-
__rT = TypeVar('rT') # return type
640-
__pT = ParamSpec('pT') # parameters type
641-
def __deprecated_inner(func: Callable[__pT, __rT]) -> Callable[__pT, __rT]:
639+
def __deprecated_inner(func: Callable) -> Callable:
642640
"""Use this decorator to mark functions as deprecated.
643641
Every time the decorated function runs, it will emit
644642
a "deprecation" warning."""
645643
@functools.wraps(func)
646-
def new_func(*args: __pT.args, **kwargs: __pT.kwargs):
644+
def new_func(*args, **kwargs):
647645
warnings.simplefilter('always', DeprecationWarning) # turn off filter
648646
warnings.warn("Call to a deprecated function {}. {}".format(func.__name__, msg),
649647
category=DeprecationWarning,

0 commit comments

Comments
 (0)