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

Method _run_args

python/scriptingprovider.py:1109–1118  ·  view source on GitHub ↗
(self, args, env: Optional[Dict]=None)

Source from the content-addressed store, hash-verified

1107
1108 # This function can only be used to execute commands that return ASCII-only output, otherwise the decoding will fail
1109 def _run_args(self, args, env: Optional[Dict]=None):
1110 si = None
1111 if sys.platform == "win32":
1112 si = subprocess.STARTUPINFO()
1113 si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
1114
1115 try:
1116 return (True, subprocess.check_output(args, startupinfo=si, stderr=subprocess.STDOUT, env=env).decode("utf-8"))
1117 except subprocess.SubprocessError as se:
1118 return (False, str(se))
1119
1120 def _pip_exists(self, python_bin: str, python_env: Optional[Dict]=None) -> bool:
1121 return self._run_args([python_bin, "-c", "import pip; pip.__version__"], env=python_env)[0]

Callers 4

_pip_existsMethod · 0.95
_bin_versionMethod · 0.95
_install_modulesMethod · 0.95

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected