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 <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2016-05-18 21:39:44 +03:00
committed by Richard Purdie
parent 63404baadb
commit 7eab022d4b
16 changed files with 51 additions and 51 deletions

View File

@@ -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)