MCPcopy Index your code
hub / github.com/python/cpython / call

Function call

Platforms/WASI/_build.py:132–158  ·  view source on GitHub ↗

Execute a command. If 'quiet' is true, then redirect stdout and stderr to a temporary file.

(command, *, context=None, quiet=False, **kwargs)

Source from the content-addressed store, hash-verified

130
131
132def call(command, *, context=None, quiet=False, **kwargs):
133 """Execute a command.
134
135 If 'quiet' is true, then redirect stdout and stderr to a temporary file.
136 """
137 if context is not None:
138 quiet = context.quiet
139
140 log("❯", " ".join(map(str, command)), spacing=" ")
141 if not quiet:
142 stdout = None
143 stderr = None
144 else:
145 if (logdir := getattr(context, "logdir", None)) is None:
146 logdir = pathlib.Path(tempfile.gettempdir())
147 stdout = tempfile.NamedTemporaryFile(
148 "w",
149 encoding="utf-8",
150 delete=False,
151 dir=logdir,
152 prefix="cpython-wasi-",
153 suffix=".log",
154 )
155 stderr = subprocess.STDOUT
156 log("📝", f"Logging output to {stdout.name} (--quiet)...")
157
158 subprocess.check_call(command, **kwargs, stdout=stdout, stderr=stderr)
159
160
161def build_python_path():

Callers 4

configure_build_pythonFunction · 0.70
make_build_pythonFunction · 0.70
configure_wasi_pythonFunction · 0.70
make_wasi_pythonFunction · 0.70

Calls 2

logFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…