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

Function write_code

Programs/_freeze_module.py:34–43  ·  view source on GitHub ↗
(outfile, marshalled: bytes, varname: str)

Source from the content-addressed store, hash-verified

32
33
34def write_code(outfile, marshalled: bytes, varname: str) -> None:
35 data_size = len(marshalled)
36
37 outfile.write(f"const unsigned char {varname}[] = {{\n")
38
39 for n in range(0, data_size, 16):
40 outfile.write(" ")
41 outfile.write(",".join(str(i) for i in marshalled[n : n + 16]))
42 outfile.write(",\n")
43 outfile.write("};\n")
44
45
46def write_frozen(outpath: str, inpath: str, name: str, marshalled: bytes) -> None:

Callers 1

write_frozenFunction · 0.85

Calls 3

strFunction · 0.85
writeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…