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

Function freeze

Tools/freeze/test/freeze.py:162–174  ·  view source on GitHub ↗
(python, scriptfile, outdir)

Source from the content-addressed store, hash-verified

160
161
162def freeze(python, scriptfile, outdir):
163 if not MAKE:
164 raise UnsupportedError('make')
165
166 print(f'freezing {scriptfile}...')
167 os.makedirs(outdir, exist_ok=True)
168 # Use -E to ignore PYTHONSAFEPATH
169 _run_quiet([python, '-E', FREEZE, '-o', outdir, scriptfile], cwd=outdir)
170 _run_quiet([MAKE], cwd=os.path.dirname(scriptfile))
171
172 name = os.path.basename(scriptfile).rpartition('.')[0]
173 executable = os.path.join(outdir, name)
174 return executable
175
176
177def run(executable):

Callers

nothing calls this directly

Calls 6

UnsupportedErrorClass · 0.85
_run_quietFunction · 0.85
dirnameMethod · 0.45
rpartitionMethod · 0.45
basenameMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…