summaryrefslogtreecommitdiffstats
path: root/scripts/cp-noerror
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cp-noerror')
-rwxr-xr-xscripts/cp-noerror12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/cp-noerror b/scripts/cp-noerror
index 28eb90d4a0..ab617c5d35 100755
--- a/scripts/cp-noerror
+++ b/scripts/cp-noerror
@@ -1,4 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-only
#
# Allow copying of $1 to $2 but if files in $1 disappear during the copy operation,
# don't error.
@@ -33,16 +35,16 @@ def copytree(src, dst, symlinks=False, ignore=None):
shutil.copy2(srcname, dstname)
# catch the Error from the recursive copytree so that we can
# continue with other files
- except shutil.Error, err:
+ except shutil.Error as err:
errors.extend(err.args[0])
- except EnvironmentError, why:
+ except EnvironmentError as why:
errors.append((srcname, dstname, str(why)))
try:
shutil.copystat(src, dst)
- except OSError, why:
+ except OSError as why:
errors.extend((src, dst, str(why)))
if errors:
- raise shutil.Error, errors
+ raise shutil.Error(errors)
try:
copytree(sys.argv[1], sys.argv[2])