MCPcopy Index your code
hub / github.com/python/mypy / execute

Function execute

misc/perf_checker.py:31–45  ·  view source on GitHub ↗
(command: list[str])

Source from the content-addressed store, hash-verified

29
30
31def execute(command: list[str]) -> None:
32 proc = subprocess.Popen(
33 " ".join(command), stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True
34 )
35 stdout_bytes, stderr_bytes = proc.communicate()
36 stdout, stderr = stdout_bytes.decode("utf-8"), stderr_bytes.decode("utf-8")
37 if proc.returncode != 0:
38 print("EXECUTED COMMAND:", repr(command))
39 print("RETURN CODE:", proc.returncode)
40 print()
41 print("STDOUT:")
42 print_offset(stdout)
43 print("STDERR:")
44 print_offset(stderr)
45 raise RuntimeError("Unexpected error from external tool.")
46
47
48def trial(num_trials: int, command: Command) -> list[float]:

Callers 1

mainFunction · 0.70

Calls 6

printFunction · 0.85
reprFunction · 0.85
RuntimeErrorClass · 0.85
print_offsetFunction · 0.70
joinMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…