提交 50979154 编写于 作者: S Simon Glass

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: NSimon Glass <sjg@chromium.org>
上级 4a4c5dd4
......@@ -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):
......
......@@ -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)
......
......@@ -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()))
......
......@@ -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
......
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册