From: Paul Burton Date: Tue, 27 Sep 2016 16:03:54 +0100 Subject: [U-Boot] [PATCH v2 06/10] patman: Use items() to iterate over dictionaries In-Reply-To: <20160927150358.6248-1-paul.burton@imgtec.com> References: <20160927150358.6248-1-paul.burton@imgtec.com> Message-ID: <20160927150358.6248-7-paul.burton@imgtec.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In python 3.x the iteritems() method has been removed from dictionaries, and the items() method does effectively the same thing. On python 2.x using items() is a little less efficient since it involves copying data, but as speed isn't a concern in this code switch to using items() anyway for simplicity. Signed-off-by: Paul Burton --- Changes in v2: - Just use items() for all python versions tools/patman/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patman/settings.py b/tools/patman/settings.py index 3caf379..7ef0ab0 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -94,7 +94,7 @@ class _ProjectConfigParser(ConfigParser.SafeConfigParser): if not self.has_section(project_settings): self.add_section(project_settings) project_defaults = _default_settings.get(project_name, {}) - for setting_name, setting_value in project_defaults.iteritems(): + for setting_name, setting_value in project_defaults.items(): self.set(project_settings, setting_name, setting_value) def get(self, section, option, *args, **kwargs): -- 2.10.0