From 7c2d4271d57d2da462859d29435740de3b412d10 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 11 Sep 2022 17:56:52 -0600 Subject: Copy(): tweak the error message for copy-a-list Signed-off-by: Mats Wichmann --- SCons/Defaults.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SCons/Defaults.py b/SCons/Defaults.py index 32b924f..40c3e4a 100644 --- a/SCons/Defaults.py +++ b/SCons/Defaults.py @@ -281,7 +281,11 @@ def copy_func(dest, src, symlinks=True) -> int: os.makedirs(dest, exist_ok=True) except FileExistsError: raise SCons.Errors.BuildError( - errstr=f'Error: Copy() called with list src but "{dest}" is not a directory' + errstr=( + 'Error: Copy() called with a list of sources, ' + 'which requires target to be a directory, ' + f'but "{dest}" is not a directory.' + ) ) for file in src: shutil.copy2(file, dest) @@ -300,8 +304,6 @@ def copy_func(dest, src, symlinks=True) -> int: else: shutil.copytree(src, dest, symlinks) - # copytree returns None in python2 and destination string in python3 - # A error is raised in both cases, so we can just return 0 for success return 0 -- cgit v0.12