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

Method write_script

Lib/test/test_interpreters/test_lifecycle.py:75–82  ·  view source on GitHub ↗
(self, *path, text)

Source from the content-addressed store, hash-verified

73 return tmp
74
75 def write_script(self, *path, text):
76 filename = os.path.join(*path)
77 dirname = os.path.dirname(filename)
78 if dirname:
79 os.makedirs(dirname, exist_ok=True)
80 with open(filename, 'w', encoding='utf-8') as outfile:
81 outfile.write(dedent(text))
82 return filename
83
84 @support.requires_subprocess()
85 def run_python(self, argv, *, cwd=None):

Callers 1

test_sys_path_0Method · 0.95

Calls 5

dedentFunction · 0.90
openFunction · 0.50
joinMethod · 0.45
dirnameMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected