summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/license.py
diff options
context:
space:
mode:
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):
47 """Get elements based on OpenEmbedded license strings""" 47 """Get elements based on OpenEmbedded license strings"""
48 def get_elements(self, licensestr): 48 def get_elements(self, licensestr):
49 new_elements = [] 49 new_elements = []
50 elements = filter(lambda x: x.strip(), license_operator.split(licensestr)) 50 elements = list([x for x in license_operator.split(licensestr) if x.strip()])
51 for pos, element in enumerate(elements): 51 for pos, element in enumerate(elements):
52 if license_pattern.match(element): 52 if license_pattern.match(element):
53 if pos > 0 and license_pattern.match(elements[pos-1]): 53 if pos > 0 and license_pattern.match(elements[pos-1]):
@@ -118,8 +118,8 @@ def is_included(licensestr, whitelist=None, blacklist=None):
118 def choose_licenses(alpha, beta): 118 def choose_licenses(alpha, beta):
119 """Select the option in an OR which is the 'best' (has the most 119 """Select the option in an OR which is the 'best' (has the most
120 included licenses).""" 120 included licenses)."""
121 alpha_weight = len(filter(include_license, alpha)) 121 alpha_weight = len(list(filter(include_license, alpha)))
122 beta_weight = len(filter(include_license, beta)) 122 beta_weight = len(list(filter(include_license, beta)))
123 if alpha_weight > beta_weight: 123 if alpha_weight > beta_weight:
124 return alpha 124 return alpha
125 else: 125 else:
@@ -132,8 +132,8 @@ def is_included(licensestr, whitelist=None, blacklist=None):
132 blacklist = [] 132 blacklist = []
133 133
134 licenses = flattened_licenses(licensestr, choose_licenses) 134 licenses = flattened_licenses(licensestr, choose_licenses)
135 excluded = filter(lambda lic: exclude_license(lic), licenses) 135 excluded = [lic for lic in licenses if exclude_license(lic)]
136 included = filter(lambda lic: include_license(lic), licenses) 136 included = [lic for lic in licenses if include_license(lic)]
137 if excluded: 137 if excluded:
138 return False, excluded 138 return False, excluded
139 else: 139 else: