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

Function run_cmd

mypy/test/testdaemon.py:79–94  ·  view source on GitHub ↗
(input: str)

Source from the content-addressed store, hash-verified

77
78
79def run_cmd(input: str) -> tuple[int, str]:
80 if input[1:].startswith("mypy run --") and "--show-error-codes" not in input:
81 input += " --hide-error-codes"
82 if input.startswith("dmypy "):
83 input = sys.executable + " -m mypy." + input
84 if input.startswith("mypy "):
85 input = sys.executable + " -m" + input
86 env = os.environ.copy()
87 env["PYTHONPATH"] = PREFIX
88 try:
89 output = subprocess.check_output(
90 input, shell=True, stderr=subprocess.STDOUT, text=True, cwd=test_temp_dir, env=env
91 )
92 return 0, output
93 except subprocess.CalledProcessError as err:
94 return err.returncode, err.output
95
96
97class DaemonUtilitySuite(unittest.TestCase):

Callers 2

run_caseMethod · 0.70
test_daemonFunction · 0.70

Calls 2

startswithMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…