diff options
| author | d0now <dolpin1402@gmail.com> | 2023-01-29 01:46:17 +0900 |
|---|---|---|
| committer | Jordan <github@psifertex.com> | 2023-03-06 16:02:52 -0500 |
| commit | 71d2ee8c8c2e6cf264ac6c9eb3f1681a12323000 (patch) | |
| tree | 60284d9c575d439fa6b516ada5db93d90cd82452 /scripts | |
| parent | 0870c907e3a63a6907361e1d75494e77e52db227 (diff) | |
install_api.py: fix None returns when getting expected binaryninja installed directory.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/install_api.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/install_api.py b/scripts/install_api.py index debba549..168ac58c 100755 --- a/scripts/install_api.py +++ b/scripts/install_api.py @@ -46,11 +46,10 @@ def binaryninja_installed() -> bool: return False -def get_binaryninja_installed_directory() -> Optional[str]: +def get_expected_binaryninja_installed_directory() -> Optional[str]: dir_name = os.path.dirname(os.path.abspath(__file__)) api_path = os.path.abspath(os.path.join(dir_name, "..", "python")) - if os.path.isdir(api_path): - return api_path + return api_path def validate_path(path: str) -> bool: @@ -84,8 +83,8 @@ def install(interactive=False, on_root=False, on_pyenv=False) -> bool: print_error("Binary Ninja API already in the path.") return False - api_path = get_binaryninja_installed_directory() - if not api_path: + api_path = get_expected_binaryninja_installed_directory() + if not os.path.isdir(api_path): print_error("Failed to find installed python expected at {}".format(api_path)) return False |
