aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-17 22:00:39 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commit2ab6e13e014c065a6168d31d6b8aeca135767816 (patch)
treef094584065244ee8dc6ab4ec3b2e80df6c7af51f /tools
parent635180538ecb7c0b109089830ff734d3d002376a (diff)
downloadu-boot-2ab6e13e014c065a6168d31d6b8aeca135767816.zip
u-boot-2ab6e13e014c065a6168d31d6b8aeca135767816.tar.gz
u-boot-2ab6e13e014c065a6168d31d6b8aeca135767816.tar.bz2
dtoc: Use binary mode for reading files
The .dtb files are binary so we should open them as binary files. This allows Python 3 to use the correct 'bytes' type. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dtoc/test_fdt.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index 3cd34b7..4c39f9a 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -85,13 +85,13 @@ class TestFdt(unittest.TestCase):
def testFlush(self):
"""Check that we can flush the device tree out to its file"""
fname = self.dtb._fname
- with open(fname) as fd:
+ with open(fname, 'rb') as fd:
data = fd.read()
os.remove(fname)
with self.assertRaises(IOError):
- open(fname)
+ open(fname, 'rb')
self.dtb.Flush()
- with open(fname) as fd:
+ with open(fname, 'rb') as fd:
data = fd.read()
def testPack(self):