MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / validate_path

Function validate_path

scripts/install_api.py:77–99  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

75
76
77def validate_path(path: str) -> bool:
78
79 try:
80 os.stat(path)
81 except OSError:
82 return False
83
84 old_path = sys.path
85 sys.path.append(path)
86
87 try:
88 from binaryninja import core_version
89 print("Found Binary Ninja core version: {}".format(core_version()))
90 except ModuleNotFoundError as e:
91 sys.path = old_path
92 if e.name == "packaging" and sys.version_info.minor >= 10:
93 raise e
94 return False
95 except ImportError as e:
96 sys.path = old_path
97 return False
98
99 return True
100
101
102def install(interactive=False, on_root=False, on_pyenv=False, force=False) -> bool:

Callers 1

installFunction · 0.85

Calls 3

core_versionFunction · 0.85
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected