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

Function copy

Platforms/Apple/testbed/__main__.py:109–119  ·  view source on GitHub ↗

An all-purpose copy. If src is a file, it is copied. If src is a symlink, it is copied *as a symlink*. If src is a directory, the full tree is duplicated, with symlinks being preserved.

(src, tgt)

Source from the content-addressed store, hash-verified

107
108
109def copy(src, tgt):
110 """An all-purpose copy.
111
112 If src is a file, it is copied. If src is a symlink, it is copied *as a
113 symlink*. If src is a directory, the full tree is duplicated, with symlinks
114 being preserved.
115 """
116 if src.is_file() or src.is_symlink():
117 shutil.copyfile(src, tgt, follow_symlinks=False)
118 else:
119 shutil.copytree(src, tgt, symlinks=True)
120
121
122def clone_testbed(

Callers 1

clone_testbedFunction · 0.70

Calls 3

copyfileMethod · 0.80
is_fileMethod · 0.45
is_symlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…