summaryrefslogtreecommitdiff
path: root/tools/binman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-14 15:53:41 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:45 -0600
commit509791542816ce984ac4716827205de49b82b282 (patch)
treee8356f14089e13bbc8bc1c6d792ca0c6e20a60c6 /tools/binman
parent4a4c5dd43f02f60717ef121aa4bb89a85465ff3c (diff)
binman: Use items() instead of iteritems()
Python 3 requires this, and Python 2 allows it. Convert the code over to ensure compatibility with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman')
-rw-r--r--tools/binman/bsection.py2
-rw-r--r--tools/binman/control.py2
-rw-r--r--tools/binman/elf.py4
-rw-r--r--tools/binman/etype/gbb.py2
-rw-r--r--tools/binman/ftest.py2
5 files changed, 6 insertions, 6 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py
index be67ff957e..3ca0592fe1 100644
--- a/tools/binman/bsection.py
+++ b/tools/binman/bsection.py
@@ -253,7 +253,7 @@ class Section(object):
"""
for entry in self._entries.values():
offset_dict = entry.GetOffsets()
- for name, info in offset_dict.iteritems():
+ for name, info in offset_dict.items():
self._SetEntryOffsetSize(name, *info)
def PackEntries(self):
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 8f7f906860..ce25eb5485 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -131,7 +131,7 @@ def Binman(options, args):
if options.image:
skip = []
- for name, image in images.iteritems():
+ for name, image in images.items():
if name not in options.image:
del images[name]
skip.append(name)
diff --git a/tools/binman/elf.py b/tools/binman/elf.py
index 97df8e32c5..828681d76d 100644
--- a/tools/binman/elf.py
+++ b/tools/binman/elf.py
@@ -59,7 +59,7 @@ def GetSymbols(fname, patterns):
flags[1] == 'w')
# Sort dict by address
- return OrderedDict(sorted(syms.iteritems(), key=lambda x: x[1].address))
+ return OrderedDict(sorted(syms.items(), key=lambda x: x[1].address))
def GetSymbolAddress(fname, sym_name):
"""Get a value of a symbol from an ELF file
@@ -98,7 +98,7 @@ def LookupAndWriteSymbols(elf_fname, entry, section):
base = syms.get('__image_copy_start')
if not base:
return
- for name, sym in syms.iteritems():
+ for name, sym in syms.items():
if name.startswith('_binman'):
msg = ("Section '%s': Symbol '%s'\n in entry '%s'" %
(section.GetPath(), name, entry.GetPath()))
diff --git a/tools/binman/etype/gbb.py b/tools/binman/etype/gbb.py
index 8fe10f4713..a94c0fca9d 100644
--- a/tools/binman/etype/gbb.py
+++ b/tools/binman/etype/gbb.py
@@ -64,7 +64,7 @@ class Entry_gbb(Entry):
self.gbb_flags = 0
flags_node = node.FindNode('flags')
if flags_node:
- for flag, value in gbb_flag_properties.iteritems():
+ for flag, value in gbb_flag_properties.items():
if fdt_util.GetBool(flags_node, flag):
self.gbb_flags |= value
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index daea1ea138..7cf17526a7 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -214,7 +214,7 @@ class TestFunctional(unittest.TestCase):
if verbosity is not None:
args.append('-v%d' % verbosity)
if entry_args:
- for arg, value in entry_args.iteritems():
+ for arg, value in entry_args.items():
args.append('-a%s=%s' % (arg, value))
if images:
for image in images: