Skip to content

Commit

Permalink
Apply fix for linux2
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Mar 8, 2024
1 parent 399f204 commit dae2391
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bindings/python/unicorn/unicorn_py3/unicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ def _load_lib(path: Path, lib_name: str):
os.getenv('LIBUNICORN_PATH'),
pkg_resources.resource_filename(__name__, 'lib'),
PurePath(inspect.getfile(__load_uc_lib)).parent / 'lib',
''
] + [PurePath(p) / 'unicorn' / 'lib' for p in sys.path]
'',
"/usr/local/lib/" if sys.platform == 'darwin' else '/usr/lib64',
] + [PurePath(p) / 'unicorn' / 'lib' for p in sys.path] # lazymio: ??? why PATH ??

# filter out None elements
lib_locations = tuple(Path(loc) for loc in lib_locations if loc is not None)
Expand All @@ -102,6 +103,7 @@ def _load_lib(path: Path, lib_name: str):
'cygwin' : 'cygunicorn.dll',
'darwin' : 'libunicorn.2.dylib',
'linux' : 'libunicorn.so.2',
'linux2': 'libunicorn.so.2',
'win32' : 'unicorn.dll'
}.get(platform, "libunicorn.so")

Expand Down

0 comments on commit dae2391

Please sign in to comment.