This commit is contained in:
@@ -17,7 +17,7 @@ def scratch_copy(top: str) -> tuple[str, str] | Failure:
|
||||
return scratch
|
||||
copy = os.path.join(scratch, "copy")
|
||||
try:
|
||||
shutil.copytree(top, copy, symlinks=True, ignore=lambda folder, names: [os.path.basename(scratch)] if folder == top else [])
|
||||
shutil.copytree(top, copy, symlinks=True, ignore=shutil.ignore_patterns(os.path.basename(scratch)))
|
||||
except OSError as failure:
|
||||
remove(scratch)
|
||||
return Failure(f"could not copy {top} into {scratch}: {failure}")
|
||||
|
||||
Reference in New Issue
Block a user