LGTM

Reviewed-by: Joshua Watt <[email protected]>

On Tue, Oct 29, 2024 at 11:07 PM Hongxu Jia <[email protected]> wrote:
>
> 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.
>
> Signed-off-by: Hongxu Jia <[email protected]>
> ---
>  meta/lib/oe/sbom30.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/lib/oe/sbom30.py b/meta/lib/oe/sbom30.py
> index 27ab5e45ac..8db90f30fd 100644
> --- a/meta/lib/oe/sbom30.py
> +++ b/meta/lib/oe/sbom30.py
> @@ -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(
> --
> 2.25.1
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206589): 
https://lists.openembedded.org/g/openembedded-core/message/206589
Mute This Topic: https://lists.openembedded.org/mt/109291174/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to