From 90a8132f4de673dbb35ffee265df93b32d6582ca Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 17 May 2019 22:00:31 -0600 Subject: 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 --- tools/dtoc/dtb_platdata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/dtoc/dtb_platdata.py') diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 17a3dccb11..4aeeab6fba 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -449,7 +449,7 @@ class DtbPlatdata(object): 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 @@ class DtbPlatdata(object): 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])) -- cgit