From 86b47250c61bd373a3d28dd05a4a231564b1bfef Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 20 Aug 2020 10:13:43 -0400 Subject: simplify shutil usage by invoking copy2 where appropriate It's equivalent to copyfile + copystat with the same arguments. --- mesonbuild/minstall.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mesonbuild/minstall.py') diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index 0be01fe..e6e973a 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -270,11 +270,9 @@ class Installer: # Remove this entire branch when changing the behaviour to duplicate # symlinks rather than copying what they point to. print(symlink_warning) - shutil.copyfile(from_file, to_file) - shutil.copystat(from_file, to_file) + shutil.copy2(from_file, to_file) else: - shutil.copyfile(from_file, to_file) - shutil.copystat(from_file, to_file) + shutil.copy2(from_file, to_file) selinux_updates.append(to_file) append_to_log(self.lf, to_file) return True -- cgit v1.1