aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/license.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 11:53:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:00 +0100
commit44e9a0d2fa759dea281fc32b602cd7878000c277 (patch)
tree69f6944e4bf34e2309ae8b3cc11eac13afcdf675 /meta/lib/oe/license.py
parent8587bce564f715e46e7317218b5c190813d3a939 (diff)
downloadopenembedded-core-contrib-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 'meta/lib/oe/license.py')
-rw-r--r--meta/lib/oe/license.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index f0f661c3ba..39ef9654fc 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -47,7 +47,7 @@ class LicenseVisitor(ast.NodeVisitor):
"""Get elements based on OpenEmbedded license strings"""
def get_elements(self, licensestr):
new_elements = []
- elements = filter(lambda x: x.strip(), license_operator.split(licensestr))
+ elements = list([x for x in license_operator.split(licensestr) if x.strip()])
for pos, element in enumerate(elements):
if license_pattern.match(element):
if pos > 0 and license_pattern.match(elements[pos-1]):
@@ -118,8 +118,8 @@ def is_included(licensestr, whitelist=None, blacklist=None):
def choose_licenses(alpha, beta):
"""Select the option in an OR which is the 'best' (has the most
included licenses)."""
- alpha_weight = len(filter(include_license, alpha))
- beta_weight = len(filter(include_license, beta))
+ alpha_weight = len(list(filter(include_license, alpha)))
+ beta_weight = len(list(filter(include_license, beta)))
if alpha_weight > beta_weight:
return alpha
else:
@@ -132,8 +132,8 @@ def is_included(licensestr, whitelist=None, blacklist=None):
blacklist = []
licenses = flattened_licenses(licensestr, choose_licenses)
- excluded = filter(lambda lic: exclude_license(lic), licenses)
- included = filter(lambda lic: include_license(lic), licenses)
+ excluded = [lic for lic in licenses if exclude_license(lic)]
+ included = [lic for lic in licenses if include_license(lic)]
if excluded:
return False, excluded
else: