From 38091b304640b0f7bfb38bae2f991775f43a93fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Anh=20Khoa?= Date: Sat, 27 Apr 2024 23:11:05 +0700 Subject: [PATCH] Add unicorn_py3 folder to setup.py (#1942) * Add unicorn_py3 folder to setup.py * Run sample in CI * Fix pip install & py2 breakage --------- Co-authored-by: mio --- bindings/python/setup.py | 2 +- bindings/python/unicorn/unicorn_py2.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index c3db4438..496b62e9 100755 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -232,7 +232,7 @@ Further information is available at http://www.unicorn-engine.org setup( provides=['unicorn'], - packages=['unicorn'], + packages=setuptools.find_packages(include=["unicorn", "unicorn.*"]), name='unicorn', version=VERSION, author='Nguyen Anh Quynh', diff --git a/bindings/python/unicorn/unicorn_py2.py b/bindings/python/unicorn/unicorn_py2.py index 1358bb27..cc5450f0 100644 --- a/bindings/python/unicorn/unicorn_py2.py +++ b/bindings/python/unicorn/unicorn_py2.py @@ -17,6 +17,9 @@ from collections import namedtuple # years since EOL of Python2 so it should be fine. from . import x86_const, arm_const, arm64_const, unicorn_const as uc +# Compatibility placeholder, nothing special here +ucsubclass = 0 + if not hasattr(sys.modules[__name__], "__file__"): __file__ = inspect.getfile(inspect.currentframe())