aboutsummaryrefslogtreecommitdiff
path: root/test/py/tests
diff options
context:
space:
mode:
authorPaul Burton2017-09-14 14:34:43 -0700
committerSimon Glass2018-07-10 14:50:50 -0600
commitdffd56d1d270e4797e43272a6c9000b8b8aeaf29 (patch)
treebef4fb8c44874d9b2a8d5214a675f80fb8d63633 /test/py/tests
parente3396ffd720877976141fa0b76a0b8ee9643d7d1 (diff)
test/py: Make print statements python 3.x safe
In python 3.x print must be called as a function rather than used as a statement. Update uses of print to the function call syntax in order to be python 3.x safe. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'test/py/tests')
-rwxr-xr-xtest/py/tests/test_fit.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py
index e407ccc05a2..a0f9350411b 100755
--- a/test/py/tests/test_fit.py
+++ b/test/py/tests/test_fit.py
@@ -3,6 +3,8 @@
#
# Sanity check of the FIT handling in U-Boot
+from __future__ import print_function
+
import os
import pytest
import struct
@@ -153,7 +155,7 @@ def test_fit(u_boot_console):
src = make_fname('u-boot.dts')
dtb = make_fname('u-boot.dtb')
with open(src, 'w') as fd:
- print >> fd, base_fdt
+ print(base_fdt, file=fd)
util.run_and_log(cons, ['dtc', src, '-O', 'dtb', '-o', dtb])
return dtb
@@ -167,7 +169,7 @@ def test_fit(u_boot_console):
"""
its = make_fname('test.its')
with open(its, 'w') as fd:
- print >> fd, base_its % params
+ print(base_its % params, file=fd)
return its
def make_fit(mkimage, params):
@@ -186,7 +188,7 @@ def test_fit(u_boot_console):
its = make_its(params)
util.run_and_log(cons, [mkimage, '-f', its, fit])
with open(make_fname('u-boot.dts'), 'w') as fd:
- print >> fd, base_fdt
+ print(base_fdt, file=fd)
return fit
def make_kernel(filename, text):
@@ -202,7 +204,7 @@ def test_fit(u_boot_console):
for i in range(100):
data += 'this %s %d is unlikely to boot\n' % (text, i)
with open(fname, 'w') as fd:
- print >> fd, data
+ print(data, file=fd)
return fname
def make_ramdisk(filename, text):
@@ -216,7 +218,7 @@ def test_fit(u_boot_console):
for i in range(100):
data += '%s %d was seldom used in the middle ages\n' % (text, i)
with open(fname, 'w') as fd:
- print >> fd, data
+ print(data, file=fd)
return fname
def find_matching(text, match):