tools: dtoc: Open all binary files in binary mode
authorSimon Glass <sjg@chromium.org>
Tue, 14 May 2019 21:53:43 +0000 (15:53 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 10 Jul 2019 22:52:45 +0000 (16:52 -0600)
Fix an open() statement to use binary mode, so that it works as expected
with Python 3.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/dtoc/fdt.py

index 9ad72f89ec7bffea7ad0dd4effcf2433191075a1..031b3a008433102eec75f78a84936351a16442b2 100644 (file)
@@ -469,7 +469,7 @@ class Fdt:
         if self._fname:
             self._fname = fdt_util.EnsureCompiled(self._fname)
 
-            with open(self._fname) as fd:
+            with open(self._fname, 'rb') as fd:
                 self._fdt_obj = libfdt.Fdt(fd.read())
 
     @staticmethod