From 7eab022d4b484aec40998f95835ba46c5da168cf Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 18 May 2016 21:39:44 +0300 Subject: scripts: Fix deprecated dict methods for python3 Replaced iteritems -> items, itervalues -> values, iterkeys -> keys or 'in' (From OE-Core rev: 25d4d8274bac696a484f83d7f3ada778cf95f4d0) Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- scripts/lib/recipetool/create_buildsys_python.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts/lib/recipetool/create_buildsys_python.py') diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index c3823307a4..cc3b5a45fd 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py @@ -238,7 +238,7 @@ class PythonRecipeHandler(RecipeHandler): # Map PKG-INFO & setup.py fields to bitbake variables bbinfo = {} - for field, values in info.iteritems(): + for field, values in info.items(): if field in self.excluded_fields: continue @@ -294,8 +294,8 @@ class PythonRecipeHandler(RecipeHandler): lines_after.append('# The upstream names may not correspond exactly to bitbake package names.') lines_after.append('#') lines_after.append('# Uncomment this line to enable all the optional features.') - lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req.iterkeys()))) - for feature, feature_reqs in extras_req.iteritems(): + lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req))) + for feature, feature_reqs in extras_req.items(): unmapped_deps.difference_update(feature_reqs) feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs)) @@ -442,8 +442,8 @@ class PythonRecipeHandler(RecipeHandler): del info[variable] elif new_value != value: info[variable] = new_value - elif hasattr(value, 'iteritems'): - for dkey, dvalue in value.iteritems(): + elif hasattr(value, 'items'): + for dkey, dvalue in value.items(): new_list = [] for pos, a_value in enumerate(dvalue): new_value = replace_value(search, replace, a_value) @@ -558,7 +558,7 @@ class PythonRecipeHandler(RecipeHandler): else: continue - for fn in files_info.iterkeys(): + for fn in files_info: for suffix in suffixes: if fn.endswith(suffix): break @@ -640,7 +640,7 @@ class SetupScriptVisitor(ast.NodeVisitor): def visit_setup(self, node): call = LiteralAstTransform().visit(node) self.keywords = call.keywords - for k, v in self.keywords.iteritems(): + for k, v in self.keywords.items(): if has_non_literals(v): self.non_literals.append(k) @@ -708,8 +708,8 @@ def has_non_literals(value): return True elif isinstance(value, basestring): return False - elif hasattr(value, 'itervalues'): - return any(has_non_literals(v) for v in value.itervalues()) + elif hasattr(value, 'values'): + return any(has_non_literals(v) for v in value.values()) elif hasattr(value, '__iter__'): return any(has_non_literals(v) for v in value) -- cgit v1.2.3-54-g00ecf