MCPcopy
hub / github.com/astral-sh/python-build-standalone / exec_and_log

Function exec_and_log

cpython-windows/build.py:201–221  ·  view source on GitHub ↗
(args, cwd, env, exit_on_error=True)

Source from the content-addressed store, hash-verified

199
200
201def exec_and_log(args, cwd, env, exit_on_error=True):
202 log("executing %s" % " ".join(args))
203
204 p = subprocess.Popen(
205 args,
206 cwd=cwd,
207 env=env,
208 bufsize=1,
209 stdout=subprocess.PIPE,
210 stderr=subprocess.STDOUT,
211 )
212
213 for line in iter(p.stdout.readline, b""):
214 log(line.rstrip())
215
216 p.wait()
217
218 log("process exited %d" % p.returncode)
219
220 if p.returncode and exit_on_error:
221 sys.exit(p.returncode)
222
223
224def find_vswhere():

Callers 3

run_msbuildFunction · 0.70
build_openssl_for_archFunction · 0.70
build_cpythonFunction · 0.70

Calls 1

logFunction · 0.70

Tested by

no test coverage detected