summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer4
-rwxr-xr-xscripts/contrib/bbvars.py14
-rwxr-xr-xscripts/cp-noerror8
-rwxr-xr-xscripts/tiny/ksize.py2
4 files changed, 14 insertions, 14 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 7c41f92744..0644cdc073 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -190,7 +190,7 @@ def runcmd(cmd,destdir=None,printerr=True,out=None,env=None):
190 err = os.tmpfile() 190 err = os.tmpfile()
191 try: 191 try:
192 subprocess.check_call(cmd, stdout=out, stderr=err, cwd=destdir, shell=isinstance(cmd, str), env=env or os.environ) 192 subprocess.check_call(cmd, stdout=out, stderr=err, cwd=destdir, shell=isinstance(cmd, str), env=env or os.environ)
193 except subprocess.CalledProcessError,e: 193 except subprocess.CalledProcessError as e:
194 err.seek(0) 194 err.seek(0)
195 if printerr: 195 if printerr:
196 logger.error("%s" % err.read()) 196 logger.error("%s" % err.read())
@@ -429,7 +429,7 @@ file_exclude = %s''' % (name, file_filter or '<empty>', repo.get('file_exclude',
429 runcmd('git replace --graft %s %s' % (start, startrev)) 429 runcmd('git replace --graft %s %s' % (start, startrev))
430 try: 430 try:
431 runcmd(merge) 431 runcmd(merge)
432 except Exception, error: 432 except Exception as error:
433 logger.info('''Merging component repository history failed, perhaps because of merge conflicts. 433 logger.info('''Merging component repository history failed, perhaps because of merge conflicts.
434It may be possible to commit anyway after resolving these conflicts. 434It may be possible to commit anyway after resolving these conflicts.
435 435
diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py
index 6f479355eb..b865dd1fac 100755
--- a/scripts/contrib/bbvars.py
+++ b/scripts/contrib/bbvars.py
@@ -37,9 +37,9 @@ def recipe_bbvars(recipe):
37 vset = set() 37 vset = set()
38 try: 38 try:
39 r = open(recipe) 39 r = open(recipe)
40 except IOError as (errno, strerror): 40 except IOError as err:
41 print('WARNING: Failed to open recipe ', recipe) 41 print('WARNING: Failed to open recipe ', recipe)
42 print(strerror) 42 print(err.args[1])
43 43
44 for line in r: 44 for line in r:
45 # Strip any comments from the line 45 # Strip any comments from the line
@@ -71,9 +71,9 @@ def bbvar_is_documented(var, docfiles):
71 for doc in docfiles: 71 for doc in docfiles:
72 try: 72 try:
73 f = open(doc) 73 f = open(doc)
74 except IOError as (errno, strerror): 74 except IOError as err:
75 print('WARNING: Failed to open doc ', doc) 75 print('WARNING: Failed to open doc ', doc)
76 print(strerror) 76 print(err.args[1])
77 for line in f: 77 for line in f:
78 if prog.match(line): 78 if prog.match(line):
79 return True 79 return True
@@ -87,8 +87,8 @@ def bbvar_doctag(var, docconf):
87 87
88 try: 88 try:
89 f = open(docconf) 89 f = open(docconf)
90 except IOError as (errno, strerror): 90 except IOError as err:
91 return strerror 91 return err.args[1]
92 92
93 for line in f: 93 for line in f:
94 m = prog.search(line) 94 m = prog.search(line)
@@ -109,7 +109,7 @@ def main():
109 # Collect and validate input 109 # Collect and validate input
110 try: 110 try:
111 opts, args = getopt.getopt(sys.argv[1:], "d:hm:t:T", ["help"]) 111 opts, args = getopt.getopt(sys.argv[1:], "d:hm:t:T", ["help"])
112 except getopt.GetoptError, err: 112 except getopt.GetoptError as err:
113 print('%s' % str(err)) 113 print('%s' % str(err))
114 usage() 114 usage()
115 sys.exit(2) 115 sys.exit(2)
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])
diff --git a/scripts/tiny/ksize.py b/scripts/tiny/ksize.py
index 275c983b8d..54b71f8e07 100755
--- a/scripts/tiny/ksize.py
+++ b/scripts/tiny/ksize.py
@@ -133,7 +133,7 @@ class Report:
133def main(): 133def main():
134 try: 134 try:
135 opts, args = getopt.getopt(sys.argv[1:], "dh", ["help"]) 135 opts, args = getopt.getopt(sys.argv[1:], "dh", ["help"])
136 except getopt.GetoptError, err: 136 except getopt.GetoptError as err:
137 print('%s' % str(err)) 137 print('%s' % str(err))
138 usage() 138 usage()
139 sys.exit(2) 139 sys.exit(2)