aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/contrib
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-02 11:45:58 +0100
commit438eabc248f272e3d272aecaa4c9cec177b172d5 (patch)
tree5be184533b66ee841de8dfe9f455382886e7b867 /scripts/contrib
parent874a269eb1d70060c2f3b3f8b70800e2aea789f4 (diff)
downloadopenembedded-core-contrib-438eabc248f272e3d272aecaa4c9cec177b172d5.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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-xscripts/contrib/bbvars.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py
index 6f479355ebf..b865dd1face 100755
--- a/scripts/contrib/bbvars.py
+++ b/scripts/contrib/bbvars.py
@@ -37,9 +37,9 @@ def recipe_bbvars(recipe):
vset = set()
try:
r = open(recipe)
- except IOError as (errno, strerror):
+ except IOError as err:
print('WARNING: Failed to open recipe ', recipe)
- print(strerror)
+ print(err.args[1])
for line in r:
# Strip any comments from the line
@@ -71,9 +71,9 @@ def bbvar_is_documented(var, docfiles):
for doc in docfiles:
try:
f = open(doc)
- except IOError as (errno, strerror):
+ except IOError as err:
print('WARNING: Failed to open doc ', doc)
- print(strerror)
+ print(err.args[1])
for line in f:
if prog.match(line):
return True
@@ -87,8 +87,8 @@ def bbvar_doctag(var, docconf):
try:
f = open(docconf)
- except IOError as (errno, strerror):
- return strerror
+ except IOError as err:
+ return err.args[1]
for line in f:
m = prog.search(line)
@@ -109,7 +109,7 @@ def main():
# Collect and validate input
try:
opts, args = getopt.getopt(sys.argv[1:], "d:hm:t:T", ["help"])
- except getopt.GetoptError, err:
+ except getopt.GetoptError as err:
print('%s' % str(err))
usage()
sys.exit(2)