File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,21 +86,24 @@ def merge_trees(src, dest):
8686 break
8787
8888 tmp = []
89- for (src , dest ) in remaining :
90- if not dest .exists :
91- ret .append ((src , dest ))
89+ for (s , d ) in remaining :
90+ if not d .exists :
91+ ret .append ((s , d ))
9292 continue
9393
94- if not src .is_dir :
95- collisions .append (src )
94+ if not s . is_dir or not d .is_dir :
95+ collisions .append (s )
9696 continue
9797
98- for f in src .readdir ():
99- tmp .append ((f , dest .get_child (f .basename )))
98+ for file_or_dir in s .readdir ():
99+ tmp .append ((file_or_dir , d .get_child (file_or_dir .basename )))
100100
101101 remaining = tmp
102102
103+ if remaining :
104+ fail ("Exceeded maximum directory depth of 10000 during tree merge." )
105+
103106 if collisions :
104- fail (lambda : "detected collisions between platlib and purelib data : {}" .format (collisions ))
107+ fail ("Detected collisions between {} and {} : {}" .format (src , dest , collisions ))
105108
106109 return ret
You can’t perform that action at this time.
0 commit comments