Fix BN installation path detection does not work with Python 3.11

This commit is contained in:
Xusheng
2023-04-10 11:41:32 +08:00
parent 7c4a46b7b4
commit 6f3bffe689
2 changed files with 4 additions and 2 deletions

View File

@@ -12,6 +12,8 @@
### Bug Fixes
- extractor: fix binja installation path detection does not work with Python 3.11
### capa explorer IDA Pro plugin
### Development

View File

@@ -15,8 +15,8 @@ import subprocess
# binaryninja module is extracted by the PyInstaller.
code = r"""
from pathlib import Path
import importlib
spec = importlib.util.find_spec('binaryninja')
from importlib import util
spec = util.find_spec('binaryninja')
if spec is not None:
if len(spec.submodule_search_locations) > 0:
path = Path(spec.submodule_search_locations[0])