Skip to content

Commit

Permalink
Merge pull request #3 from lsst/tickets/DM-32976
Browse files Browse the repository at this point in the history
DM-32976: Use copy instead of copy2.
  • Loading branch information
ktlim committed Dec 15, 2021
2 parents 2359392 + 62c5206 commit 04ba59d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/lsst/resources/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,10 @@ def transfer_from(
pass

if transfer == "move":
with transaction.undoWith(f"move from {local_src}", shutil.move, newFullPath, local_src):
shutil.move(local_src, newFullPath)
with transaction.undoWith(
f"move from {local_src}", shutil.move, newFullPath, local_src, copy_function=shutil.copy
):
shutil.move(local_src, newFullPath, copy_function=shutil.copy)
elif transfer == "copy":
with transaction.undoWith(f"copy from {local_src}", os.remove, newFullPath):
shutil.copy(local_src, newFullPath)
Expand Down

0 comments on commit 04ba59d

Please sign in to comment.