mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 18:32:12 +02:00
meta/lib/oe/sbom30.py: correct python list comprehension
The python list comprehension is not right for list:
>>> license_text_map = {'LicenseRef-FSF-Unlimited': 'http://spdx.org/spdxdocs/gettext-minimal-native-1fa0d5cb-2bb8-5631-9fab-cd219801733f/8d31e22acc4a8979f24dc24042692fb548fc8fc8d85d775ddac406abb122ceea/license-text/FSF-Unlimited'}
>>> license_text = ((k, license_text_map[k]) for k in sorted(license_text_map.keys()))
>>> print(license_text)
<generator object <genexpr> at 0x7f8575173270>
>>> [(k,v) for k, v in license_text]
[]
Change the () to [] to make it a list instead of a generator expression.
(From OE-Core rev: e13c54645bf716ddfb19606fd212cc349b570ad4)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
f1f814c4f7
commit
f964b31c68
@@ -577,9 +577,9 @@ class ObjectSet(oe.spdx30.SHACLObjectSet):
|
||||
re.sub(r"[^a-zA-Z0-9_-]", "_", license_expression),
|
||||
]
|
||||
|
||||
license_text = (
|
||||
license_text = [
|
||||
(k, license_text_map[k]) for k in sorted(license_text_map.keys())
|
||||
)
|
||||
]
|
||||
|
||||
if not license_text:
|
||||
lic = self.find_filter(
|
||||
|
||||
Reference in New Issue
Block a user