MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / run_process

Function run_process

tools/utils.py:32–48  ·  view source on GitHub ↗

Run a subprocess returning the exit code. By default this function will raise an exception on failure. Therefore this should only be used if you want to handle such failures. For most subprocesses, failures are not recoverable and should be fatal. In those cases the `check_call` wrapper sh

(cmd, check=True, input=None, *args, **kw)

Source from the content-addressed store, hash-verified

30
31
32def run_process(cmd, check=True, input=None, *args, **kw):
33 """Run a subprocess returning the exit code.
34
35 By default this function will raise an exception on failure. Therefore this should only be
36 used if you want to handle such failures. For most subprocesses, failures are not recoverable
37 and should be fatal. In those cases the `check_call` wrapper should be preferred.
38 """
39 # Flush standard streams otherwise the output of the subprocess may appear in the
40 # output before messages that we have already written.
41 sys.stdout.flush()
42 sys.stderr.flush()
43 kw.setdefault('text', True)
44 kw.setdefault('encoding', 'utf-8')
45 ret = subprocess.run(cmd, check=check, input=input, *args, **kw)
46 debug_text = '%sexecuted %s' % ('successfully ' if check else '', shlex.join(cmd))
47 logger.debug(debug_text)
48 return ret
49
50
51def get_env_bool(name, default='0'):

Callers 15

__enter__Method · 0.90
__enter__Method · 0.90
runMethod · 0.90
buildMethod · 0.90
runMethod · 0.90
buildMethod · 0.90
buildMethod · 0.90
setUpClassMethod · 0.90
get_clang_native_argsFunction · 0.90
get_clang_native_envFunction · 0.90
run_benchmarkFunction · 0.90
check_closure_compilerFunction · 0.85

Calls 3

flushMethod · 0.45
runMethod · 0.45
joinMethod · 0.45

Tested by 8

__enter__Method · 0.72
__enter__Method · 0.72
runMethod · 0.72
buildMethod · 0.72
runMethod · 0.72
buildMethod · 0.72
buildMethod · 0.72
setUpClassMethod · 0.72