summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/shell.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-20 12:08:07 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:37 +0100
commitef1de9ecaf73e28234d284b79ec45e084d0f0c53 (patch)
tree417f87922c1a2fa4a3bbd4b35e0772221f96641e /bitbake/lib/bb/shell.py
parent20dc452614c991d1a4f5b7dcc1307cd03cba0c55 (diff)
downloadpoky-ef1de9ecaf73e28234d284b79ec45e084d0f0c53.tar.gz
Apply some 2to3 refactorings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/shell.py')
-rw-r--r--bitbake/lib/bb/shell.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py
index aeead679b2..f9ca9d5bd3 100644
--- a/bitbake/lib/bb/shell.py
+++ b/bitbake/lib/bb/shell.py
@@ -53,6 +53,7 @@ PROBLEMS:
53########################################################################## 53##########################################################################
54 54
55from __future__ import print_function 55from __future__ import print_function
56from functools import reduce
56try: 57try:
57 set 58 set
58except NameError: 59except NameError:
@@ -178,12 +179,12 @@ class BitBakeShellCommands:
178 print("ERROR: No Provider") 179 print("ERROR: No Provider")
179 last_exception = Providers.NoProvider 180 last_exception = Providers.NoProvider
180 181
181 except runqueue.TaskFailure, fnids: 182 except runqueue.TaskFailure as fnids:
182 for fnid in fnids: 183 for fnid in fnids:
183 print("ERROR: '%s' failed" % td.fn_index[fnid]) 184 print("ERROR: '%s' failed" % td.fn_index[fnid])
184 last_exception = runqueue.TaskFailure 185 last_exception = runqueue.TaskFailure
185 186
186 except build.EventException, e: 187 except build.EventException as e:
187 print("ERROR: Couldn't build '%s'" % names) 188 print("ERROR: Couldn't build '%s'" % names)
188 last_exception = e 189 last_exception = e
189 190
@@ -246,7 +247,7 @@ class BitBakeShellCommands:
246 cooker.buildFile(bf, cmd) 247 cooker.buildFile(bf, cmd)
247 except parse.ParseError: 248 except parse.ParseError:
248 print("ERROR: Unable to open or parse '%s'" % bf) 249 print("ERROR: Unable to open or parse '%s'" % bf)
249 except build.EventException, e: 250 except build.EventException as e:
250 print("ERROR: Couldn't build '%s'" % name) 251 print("ERROR: Couldn't build '%s'" % name)
251 last_exception = e 252 last_exception = e
252 253
@@ -644,7 +645,7 @@ def columnize( alist, width = 80 ):
644 return reduce(lambda line, word, width=width: '%s%s%s' % 645 return reduce(lambda line, word, width=width: '%s%s%s' %
645 (line, 646 (line,
646 ' \n'[(len(line[line.rfind('\n')+1:]) 647 ' \n'[(len(line[line.rfind('\n')+1:])
647 + len(word.split('\n',1)[0] 648 + len(word.split('\n', 1)[0]
648 ) >= width)], 649 ) >= width)],
649 word), 650 word),
650 alist 651 alist