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

Function copy_source_tree

Tools/freeze/test/freeze.py:87–98  ·  view source on GitHub ↗
(newroot, oldroot)

Source from the content-addressed store, hash-verified

85
86
87def copy_source_tree(newroot, oldroot):
88 print(f'copying the source tree from {oldroot} to {newroot}...')
89 if os.path.exists(newroot):
90 if newroot == SRCDIR:
91 raise Exception('this probably isn\'t what you wanted')
92 shutil.rmtree(newroot)
93
94 shutil.copytree(oldroot, newroot, ignore=support.copy_python_src_ignore)
95 if os.path.exists(os.path.join(newroot, 'Makefile')):
96 # Out-of-tree builds require a clean srcdir. "make clean" keeps
97 # the "python" program, so use "make distclean" instead.
98 _run_quiet([MAKE, 'distclean'], cwd=newroot)
99
100
101##################################

Callers 1

prepareFunction · 0.85

Calls 3

_run_quietFunction · 0.85
existsMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…