diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-20 11:53:11 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:00 +0100 |
commit | 44e9a0d2fa759dea281fc32b602cd7878000c277 (patch) | |
tree | 69f6944e4bf34e2309ae8b3cc11eac13afcdf675 /scripts | |
parent | 8587bce564f715e46e7317218b5c190813d3a939 (diff) | |
download | poky-44e9a0d2fa759dea281fc32b602cd7878000c277.tar.gz |
classes/lib: Update to explictly create lists where needed
Iterators now return views, not lists in python3. Where we need
lists, handle this explicitly.
(From OE-Core rev: caebd862bac7eed725e0f0321bf50793671b5312)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/standard.py | 12 | ||||
-rwxr-xr-x | scripts/oe-selftest | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 3be32147ab..18847cf4ee 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -321,7 +321,7 @@ def _git_exclude_path(srctree, path): | |||
321 | # becomes greater than that. | 321 | # becomes greater than that. |
322 | path = os.path.normpath(path) | 322 | path = os.path.normpath(path) |
323 | recurse = True if len(path.split(os.path.sep)) > 1 else False | 323 | recurse = True if len(path.split(os.path.sep)) > 1 else False |
324 | git_files = _git_ls_tree(srctree, 'HEAD', recurse).keys() | 324 | git_files = list(_git_ls_tree(srctree, 'HEAD', recurse).keys()) |
325 | if path in git_files: | 325 | if path in git_files: |
326 | git_files.remove(path) | 326 | git_files.remove(path) |
327 | return git_files | 327 | return git_files |
@@ -1073,14 +1073,14 @@ def _update_recipe_srcrev(args, srctree, rd, config_data): | |||
1073 | patches_dir) | 1073 | patches_dir) |
1074 | 1074 | ||
1075 | # Remove deleted local files and "overlapping" patches | 1075 | # Remove deleted local files and "overlapping" patches |
1076 | remove_files = del_f.values() + upd_p.values() | 1076 | remove_files = list(del_f.values()) + list(upd_p.values()) |
1077 | if remove_files: | 1077 | if remove_files: |
1078 | removedentries = _remove_file_entries(srcuri, remove_files)[0] | 1078 | removedentries = _remove_file_entries(srcuri, remove_files)[0] |
1079 | update_srcuri = True | 1079 | update_srcuri = True |
1080 | 1080 | ||
1081 | if args.append: | 1081 | if args.append: |
1082 | files = dict((os.path.join(local_files_dir, key), val) for | 1082 | files = dict((os.path.join(local_files_dir, key), val) for |
1083 | key, val in upd_f.items() + new_f.items()) | 1083 | key, val in list(upd_f.items()) + list(new_f.items())) |
1084 | removevalues = {} | 1084 | removevalues = {} |
1085 | if update_srcuri: | 1085 | if update_srcuri: |
1086 | removevalues = {'SRC_URI': removedentries} | 1086 | removevalues = {'SRC_URI': removedentries} |
@@ -1142,7 +1142,7 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data): | |||
1142 | upd_p, new_p, del_p = _export_patches(srctree, rd, initial_rev, | 1142 | upd_p, new_p, del_p = _export_patches(srctree, rd, initial_rev, |
1143 | all_patches_dir) | 1143 | all_patches_dir) |
1144 | # Remove deleted local files and patches | 1144 | # Remove deleted local files and patches |
1145 | remove_files = del_f.values() + del_p.values() | 1145 | remove_files = list(del_f.values()) + list(del_p.values()) |
1146 | 1146 | ||
1147 | # Get updated patches from source tree | 1147 | # Get updated patches from source tree |
1148 | patches_dir = tempfile.mkdtemp(dir=tempdir) | 1148 | patches_dir = tempfile.mkdtemp(dir=tempdir) |
@@ -1154,9 +1154,9 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data): | |||
1154 | srcuri = (rd.getVar('SRC_URI', False) or '').split() | 1154 | srcuri = (rd.getVar('SRC_URI', False) or '').split() |
1155 | if args.append: | 1155 | if args.append: |
1156 | files = dict((os.path.join(local_files_dir, key), val) for | 1156 | files = dict((os.path.join(local_files_dir, key), val) for |
1157 | key, val in upd_f.items() + new_f.items()) | 1157 | key, val in list(upd_f.items()) + list(new_f.items())) |
1158 | files.update(dict((os.path.join(patches_dir, key), val) for | 1158 | files.update(dict((os.path.join(patches_dir, key), val) for |
1159 | key, val in upd_p.items() + new_p.items())) | 1159 | key, val in list(upd_p.items()) + list(new_p.items()))) |
1160 | if files or remove_files: | 1160 | if files or remove_files: |
1161 | removevalues = None | 1161 | removevalues = None |
1162 | if remove_files: | 1162 | if remove_files: |
diff --git a/scripts/oe-selftest b/scripts/oe-selftest index 00ef51f516..db132fdf9f 100755 --- a/scripts/oe-selftest +++ b/scripts/oe-selftest | |||
@@ -211,7 +211,7 @@ def get_tests_from_module(tmod): | |||
211 | try: | 211 | try: |
212 | import importlib | 212 | import importlib |
213 | modlib = importlib.import_module(tmod) | 213 | modlib = importlib.import_module(tmod) |
214 | for mod in vars(modlib).values(): | 214 | for mod in list(vars(modlib).values()): |
215 | if isinstance(mod, type(oeSelfTest)) and issubclass(mod, oeSelfTest) and mod is not oeSelfTest: | 215 | if isinstance(mod, type(oeSelfTest)) and issubclass(mod, oeSelfTest) and mod is not oeSelfTest: |
216 | for test in dir(mod): | 216 | for test in dir(mod): |
217 | if test.startswith('test_') and hasattr(vars(mod)[test], '__call__'): | 217 | if test.startswith('test_') and hasattr(vars(mod)[test], '__call__'): |