Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bindings/python/unicorn/unicorn_py3/unicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,17 @@ def _load_lib(path: Path, lib_name: str):
# - global load
# - python's lib directory

if sys.version_info.minor >= 12:
if sys.version_info >= (3, 9):
from importlib import resources

canonicals = resources.files('unicorn') / 'lib'
else:
import pkg_resources
try:
import pkg_resources

canonicals = pkg_resources.resource_filename('unicorn', 'lib')
canonicals = pkg_resources.resource_filename('unicorn', 'lib')
except ImportError:
canonicals = None

lib_locations = [
os.getenv('LIBUNICORN_PATH'),
Expand Down