MCPcopy
hub / github.com/pex-tool/pex / write_source

Function write_source

tests/test_compiler.py:22–27  ·  view source on GitHub ↗
(path, valid=True)

Source from the content-addressed store, hash-verified

20
21
22def write_source(path, valid=True):
23 # type: (str, bool) -> None
24 with safe_open(path, "wb") as fp:
25 fp.write(to_bytes("basename = %r\n" % os.path.basename(path)))
26 if not valid:
27 fp.write(to_bytes("invalid!\n"))
28
29
30@contextlib.contextmanager

Callers 1

compilationFunction · 0.85

Calls 3

safe_openFunction · 0.90
to_bytesFunction · 0.90
writeMethod · 0.45

Tested by

no test coverage detected