dtoc: Adjust code for Python 3
Update a few things in this tool so that they support Python 3:
- print statements
- iteritems()
- xrange()
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 17a3dcc..4aeeab6 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -449,7 +449,7 @@
self.out(';\n')
self.out('};\n')
- for alias, struct_name in self._aliases.iteritems():
+ for alias, struct_name in self._aliases.items():
if alias not in sorted(structs):
self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias,
STRUCT_PREFIX, struct_name))
@@ -498,7 +498,7 @@
vals.append(get_value(prop.type, val))
# Put 8 values per line to avoid very long lines.
- for i in xrange(0, len(vals), 8):
+ for i in range(0, len(vals), 8):
if i:
self.buf(',\n\t\t')
self.buf(', '.join(vals[i:i + 8]))