diff --git a/manticore/platforms/platform.py b/manticore/platforms/platform.py index 859cdd1b6..9cc8d7a4c 100644 --- a/manticore/platforms/platform.py +++ b/manticore/platforms/platform.py @@ -1,7 +1,7 @@ -import wrapt import logging from ..utils.event import Eventful +from functools import wraps from typing import Callable, Dict, Tuple logger = logging.getLogger(__name__) @@ -11,17 +11,20 @@ class OSException(Exception): pass -@wrapt.decorator -def unimplemented(wrapped: Callable, _instance, args: Tuple, kwargs: Dict): - cpu = getattr(getattr(_instance, "parent", None), "current", None) - addr_str = "" if cpu is None else f" at {hex(cpu.read_register('PC'))}" - logger.warning( - f"Unimplemented system call: %s: %s(%s)", - addr_str, - wrapped.__name__, - ", ".join(hex(a) if isinstance(a, int) else str(a) for a in args), - ) - return wrapped(*args, **kwargs) +def unimplemented(wrapped: Callable) -> Callable: + @wraps(wrapped) + def new_wrapped(*args, **kwargs): + cpu = getattr(getattr(_instance, "parent", None), "current", None) + addr_str = "" if cpu is None else f" at {hex(cpu.read_register('PC'))}" + logger.warning( + f"Unimplemented system call: %s: %s(%s)", + addr_str, + wrapped.__name__, + ", ".join(hex(a) if isinstance(a, int) else str(a) for a in args), + ) + return wrapped(*args, **kwargs) + + return new_wrapped class SyscallNotImplemented(OSException): diff --git a/mypy.ini b/mypy.ini index 5ded6ce08..82669511c 100644 --- a/mypy.ini +++ b/mypy.ini @@ -37,9 +37,6 @@ ignore_missing_imports = True [mypy-prettytable.*] ignore_missing_imports = True -[mypy-wrapt.*] -ignore_missing_imports = True - [mypy-wasm.*] ignore_missing_imports = True diff --git a/setup.py b/setup.py index bb2f36b3e..4e593157e 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,6 @@ def rtd_dependent_deps(): python_requires=">=3.6", install_requires=[ "pyyaml", - "wrapt", # evm dependencies "pysha3", "prettytable",