summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-14 15:53:37 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:45 -0600
commit2ca8468026b678c8630ad99290cc5d2428eaeb55 (patch)
treea149d9ff09a7c7654d83d0467480028be81f46ea /tools
parent5a1af1dafeab06f0ef3bb749ec0ce59784bf8925 (diff)
binman: Convert print statements to Python 3
Update all print statements to be functions, as required by Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/binman/binman.py14
-rw-r--r--tools/binman/control.py6
2 files changed, 12 insertions, 8 deletions
diff --git a/tools/binman/binman.py b/tools/binman/binman.py
index 439908e6650..4206d2b0e3d 100755
--- a/tools/binman/binman.py
+++ b/tools/binman/binman.py
@@ -9,6 +9,8 @@
"""See README for more information"""
+from __future__ import print_function
+
import glob
import multiprocessing
import os
@@ -85,13 +87,13 @@ def RunTests(debug, processes, args):
else:
suite.run(result)
- print result
+ print(result)
for test, err in result.errors:
- print test.id(), err
+ print(test.id(), err)
for test, err in result.failures:
- print err, result.failures
+ print(err, result.failures)
if result.errors or result.failures:
- print 'binman tests FAILED'
+ print('binman tests FAILED')
return 1
return 0
@@ -143,9 +145,9 @@ def RunBinman(options, args):
try:
ret_code = control.Binman(options, args)
except Exception as e:
- print 'binman: %s' % e
+ print('binman: %s' % e)
if options.debug:
- print
+ print()
traceback.print_exc()
ret_code = 1
return ret_code
diff --git a/tools/binman/control.py b/tools/binman/control.py
index b32e4e1996f..8f7f9068604 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -5,6 +5,8 @@
# Creates binary images from input files controlled by a description
#
+from __future__ import print_function
+
from collections import OrderedDict
import os
import sys
@@ -134,7 +136,7 @@ def Binman(options, args):
del images[name]
skip.append(name)
if skip and options.verbosity >= 2:
- print 'Skipping images: %s' % ', '.join(skip)
+ print('Skipping images: %s' % ', '.join(skip))
state.Prepare(images, dtb)
@@ -170,7 +172,7 @@ def Binman(options, args):
except Exception as e:
if options.map:
fname = image.WriteMap()
- print "Wrote map file '%s' to show errors" % fname
+ print("Wrote map file '%s' to show errors" % fname)
raise
image.SetImagePos()
if options.update_fdt: