summaryrefslogtreecommitdiffstats
path: root/scripts/cp-noerror
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-06-02 13:12:48 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-03 13:13:28 +0100
commitee31bad7627a7c8590a5a7dd3ffc210872067f44 (patch)
treec40c6171e80ec97e1553620e84c2b6d289ae43ab /scripts/cp-noerror
parent07c97db27288cf806900b13e55fe37e4bf22e889 (diff)
downloadpoky-ee31bad7627a7c8590a5a7dd3ffc210872067f44.tar.gz
scripts: python3: use new style except statement
Changed old syle except statements 'except <exception>, var' to new style 'except <exception> as var' as old style is not supported in python3. (From OE-Core rev: 438eabc248f272e3d272aecaa4c9cec177b172d5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/cp-noerror')
-rwxr-xr-xscripts/cp-noerror8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/cp-noerror b/scripts/cp-noerror
index 28eb90d4a0..d8be6774c7 100755
--- a/scripts/cp-noerror
+++ b/scripts/cp-noerror
@@ -33,16 +33,16 @@ def copytree(src, dst, symlinks=False, ignore=None):
33 shutil.copy2(srcname, dstname) 33 shutil.copy2(srcname, dstname)
34 # catch the Error from the recursive copytree so that we can 34 # catch the Error from the recursive copytree so that we can
35 # continue with other files 35 # continue with other files
36 except shutil.Error, err: 36 except shutil.Error as err:
37 errors.extend(err.args[0]) 37 errors.extend(err.args[0])
38 except EnvironmentError, why: 38 except EnvironmentError as why:
39 errors.append((srcname, dstname, str(why))) 39 errors.append((srcname, dstname, str(why)))
40 try: 40 try:
41 shutil.copystat(src, dst) 41 shutil.copystat(src, dst)
42 except OSError, why: 42 except OSError as why:
43 errors.extend((src, dst, str(why))) 43 errors.extend((src, dst, str(why)))
44 if errors: 44 if errors:
45 raise shutil.Error, errors 45 raise shutil.Error(errors)
46 46
47try: 47try:
48 copytree(sys.argv[1], sys.argv[2]) 48 copytree(sys.argv[1], sys.argv[2])