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

Method run

Lib/test/test_interpreters/test_api.py:1401–1410  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

1399 script_helper.make_script(tempdir, name, dedent(text))
1400
1401 def run(text):
1402 name = 'myscript'
1403 text = dedent(f"""
1404 import sys
1405 sys.path.insert(0, {tempdir!r})
1406
1407 """) + dedent(text)
1408 filename = script_helper.make_script(tempdir, name, text)
1409 res = script_helper.assert_python_ok(filename)
1410 return res.out.decode('utf-8').strip()
1411
1412 # no module indirection
1413 with self.subTest('no indirection'):

Callers

nothing calls this directly

Calls 5

dedentFunction · 0.90
assert_python_okMethod · 0.80
make_scriptMethod · 0.45
stripMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected