diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-06-02 13:12:48 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-03 13:13:28 +0100 |
commit | ee31bad7627a7c8590a5a7dd3ffc210872067f44 (patch) | |
tree | c40c6171e80ec97e1553620e84c2b6d289ae43ab /scripts/contrib/bbvars.py | |
parent | 07c97db27288cf806900b13e55fe37e4bf22e889 (diff) | |
download | poky-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/contrib/bbvars.py')
-rwxr-xr-x | scripts/contrib/bbvars.py | 14 |
1 files changed, 7 insertions, 7 deletions
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) |