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/interpreter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mesonbuild/interpreter.py') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index dc231cc..3a61c66 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -4368,8 +4368,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self if len(inputs_abs) != 1: raise InterpreterException('Exactly one input file must be given in copy mode') os.makedirs(os.path.join(self.environment.build_dir, self.subdir), exist_ok=True) - shutil.copyfile(inputs_abs[0], ofile_abs) - shutil.copystat(inputs_abs[0], ofile_abs) + shutil.copy2(inputs_abs[0], ofile_abs) else: # Not reachable raise AssertionError -- cgit v1.1