Merge "releasetools: Replace iteritems with items."

This commit is contained in:
Tao Bao
2019-07-11 18:07:19 +00:00
committed by Gerrit Code Review

View File

@@ -1460,7 +1460,7 @@ class PasswordManager(object):
values. values.
""" """
result = {} result = {}
for k, v in sorted(current.iteritems()): for k, v in sorted(current.items()):
if v: if v:
result[k] = v result[k] = v
else: else:
@@ -1481,7 +1481,7 @@ class PasswordManager(object):
f.write("# (Additional spaces are harmless.)\n\n") f.write("# (Additional spaces are harmless.)\n\n")
first_line = None first_line = None
sorted_list = sorted([(not v, k, v) for (k, v) in current.iteritems()]) sorted_list = sorted([(not v, k, v) for (k, v) in current.items()])
for i, (_, k, v) in enumerate(sorted_list): for i, (_, k, v) in enumerate(sorted_list):
f.write("[[[ %s ]]] %s\n" % (v, k)) f.write("[[[ %s ]]] %s\n" % (v, k))
if not v and first_line is None: if not v and first_line is None:
@@ -1647,7 +1647,7 @@ class DeviceSpecificParams(object):
"""Keyword arguments to the constructor become attributes of this """Keyword arguments to the constructor become attributes of this
object, which is passed to all functions in the device-specific object, which is passed to all functions in the device-specific
module.""" module."""
for k, v in kwargs.iteritems(): for k, v in kwargs.items():
setattr(self, k, v) setattr(self, k, v)
self.extras = OPTIONS.extras self.extras = OPTIONS.extras