Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
fix tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
reidpr committed Oct 24, 2023
1 parent aee8e97 commit fd016bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,20 @@ def copy(self, dst):
os.close(src_fd)
os.close(dst_fd)
except OSError as x:
FATAL("can’t copy (fast): %s -> %s: %s" % (self, dst, x.strerror))
ch.FATAL("can’t copy data (fast): %s -> %s: %s"
% (self, dst, x.strerror))
else:
# Slow path.
try:
shutil.copyfile(self, dst, follow_symlinks=False)
except OSError as x:
FATAL("can’t copy (slow): %s -> %s: %s" % (self, dst, x.strerror))
ch.FATAL("can’t copy data (slow): %s -> %s: %s"
% (self, dst, x.strerror))
try:
# Metadata.
shutil.copystat(self, dst, follow_symlinks=False)
except OSError as x:
FATAL("can’t copy metadata: %s -> %s" % (self, dst, x.strerror))
ch.FATAL("can’t copy metadata: %s -> %s" % (self, dst, x.strerror))

def copytree(self, *args, **kwargs):
"Wrapper for shutil.copytree() that exits on the first error."
Expand Down

0 comments on commit fd016bf

Please sign in to comment.