Apply fix for linux2

This commit is contained in:
mio
2024-03-08 16:19:53 +08:00
parent 399f204787
commit dae2391bb0

View File

@@ -92,8 +92,9 @@ def __load_uc_lib() -> ctypes.CDLL:
os.getenv('LIBUNICORN_PATH'), os.getenv('LIBUNICORN_PATH'),
pkg_resources.resource_filename(__name__, 'lib'), pkg_resources.resource_filename(__name__, 'lib'),
PurePath(inspect.getfile(__load_uc_lib)).parent / '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 # filter out None elements
lib_locations = tuple(Path(loc) for loc in lib_locations if loc is not None) lib_locations = tuple(Path(loc) for loc in lib_locations if loc is not None)
@@ -102,6 +103,7 @@ def __load_uc_lib() -> ctypes.CDLL:
'cygwin' : 'cygunicorn.dll', 'cygwin' : 'cygunicorn.dll',
'darwin' : 'libunicorn.2.dylib', 'darwin' : 'libunicorn.2.dylib',
'linux' : 'libunicorn.so.2', 'linux' : 'libunicorn.so.2',
'linux2': 'libunicorn.so.2',
'win32' : 'unicorn.dll' 'win32' : 'unicorn.dll'
}.get(platform, "libunicorn.so") }.get(platform, "libunicorn.so")