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

Function dump

Programs/freeze_test_frozenmain.py:21–30  ·  view source on GitHub ↗
(fp, filename, name)

Source from the content-addressed store, hash-verified

19
20
21def dump(fp, filename, name):
22 # Strip the directory to get reproducible marshal dump
23 code_filename = os.path.basename(filename)
24
25 with tokenize.open(filename) as source_fp:
26 source = source_fp.read()
27 code = compile(source, code_filename, 'exec', module=name)
28
29 data = marshal.dumps(code)
30 writecode(fp, name, data)
31
32
33def main():

Callers 1

mainFunction · 0.70

Calls 6

writecodeFunction · 0.70
compileFunction · 0.50
basenameMethod · 0.45
openMethod · 0.45
readMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…