@@ -52,30 +52,16 @@ def aslist(l): # type: (Any) -> List[Any]
52
52
return l
53
53
return [l ]
54
54
55
- def copytree_with_merge (src , dst , symlinks = False , ignore = None ):
56
- # type: (Text, Text, bool, Callable[..., Any]) -> None
55
+ def copytree_with_merge (src , dst ): # type: (Text, Text) -> None
57
56
if not os .path .exists (dst ):
58
57
os .makedirs (dst )
59
58
shutil .copystat (src , dst )
60
59
lst = os .listdir (src )
61
- if ignore :
62
- excl = ignore (src , lst )
63
- lst = [x for x in lst if x not in excl ]
64
60
for item in lst :
65
61
spath = os .path .join (src , item )
66
62
dpath = os .path .join (dst , item )
67
- if symlinks and os .path .islink (spath ):
68
- if os .path .lexists (dpath ):
69
- os .remove (dpath )
70
- os .symlink (os .readlink (spath ), dpath )
71
- try :
72
- s_stat = os .lstat (spath )
73
- mode = stat .S_IMODE (s_stat .st_mode )
74
- os .lchmod (dpath , mode )
75
- except :
76
- pass # lchmod not available, only available on unix
77
- elif os .path .isdir (spath ):
78
- copytree_with_merge (spath , dpath , symlinks , ignore )
63
+ if os .path .isdir (spath ):
64
+ copytree_with_merge (spath , dpath )
79
65
else :
80
66
shutil .copy2 (spath , dpath )
81
67
@@ -144,7 +130,6 @@ def onWindows():
144
130
return os .name == 'nt'
145
131
146
132
147
-
148
133
def convert_pathsep_to_unix (path ): # type: (Text) -> (Text)
149
134
"""
150
135
On windows os.path.join would use backslash to join path, since we would
0 commit comments