[oe-commits] [openembedded-core] 20/24: python3: convert views to lists
git at git.openembedded.org
git at git.openembedded.org
Sun May 22 15:13:01 UTC 2016
rpurdie pushed a commit to branch python3
in repository openembedded-core.
commit ba002fbdeb005d0ab2e3ca5f46ff089c5f9c457c
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Fri May 20 11:52:15 2016 +0300
python3: convert views to lists
dict.keys(), dict.items() and dict.values() return
views in python 3:
https://docs.python.org/3.0/whatsnew/3.0.html#views-and-iterators-instead-of-lists
Some operations are not supported by views, e.g. it's not
possible to use '+' operation on them. Converting views
to list should solve this.
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
scripts/lib/devtool/standard.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index ecfa84e..db464e9 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -319,7 +319,7 @@ def _git_exclude_path(srctree, path):
# becomes greater than that.
path = os.path.normpath(path)
recurse = True if len(path.split(os.path.sep)) > 1 else False
- git_files = _git_ls_tree(srctree, 'HEAD', recurse).keys()
+ git_files = list(_git_ls_tree(srctree, 'HEAD', recurse).keys())
if path in git_files:
git_files.remove(path)
return git_files
@@ -1071,14 +1071,14 @@ def _update_recipe_srcrev(args, srctree, rd, config_data):
patches_dir)
# Remove deleted local files and "overlapping" patches
- remove_files = del_f.values() + upd_p.values()
+ remove_files = list(del_f.values()) + list(upd_p.values())
if remove_files:
removedentries = _remove_file_entries(srcuri, remove_files)[0]
update_srcuri = True
if args.append:
files = dict((os.path.join(local_files_dir, key), val) for
- key, val in upd_f.items() + new_f.items())
+ key, val in list(upd_f.items()) + list(new_f.items()))
removevalues = {}
if update_srcuri:
removevalues = {'SRC_URI': removedentries}
@@ -1140,7 +1140,7 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data):
upd_p, new_p, del_p = _export_patches(srctree, rd, initial_rev,
all_patches_dir)
# Remove deleted local files and patches
- remove_files = del_f.values() + del_p.values()
+ remove_files = list(del_f.values()) + list(del_p.values())
# Get updated patches from source tree
patches_dir = tempfile.mkdtemp(dir=tempdir)
@@ -1152,9 +1152,9 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data):
srcuri = (rd.getVar('SRC_URI', False) or '').split()
if args.append:
files = dict((os.path.join(local_files_dir, key), val) for
- key, val in upd_f.items() + new_f.items())
+ key, val in list(upd_f.items()) + list(new_f.items()))
files.update(dict((os.path.join(patches_dir, key), val) for
- key, val in upd_p.items() + new_p.items()))
+ key, val in list(upd_p.items()) + list(new_p.items())))
if files or remove_files:
removevalues = None
if remove_files:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list