[OE-core][PATCH 4/6] classes/spdx-common: Return empty list from extract_licenses

Joshua Watt
2024-06-10T21:45:13Z

This is nicer as the normal return type is a list, so the calling code
doesn't have to deal with a None sometimes and a list others.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/classes/spdx-common.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/spdx-common.bbclass b/meta/classes/spdx-common.bbclass
index f6fc182838d..03f1d0cc278 100644
--- a/meta/classes/spdx-common.bbclass
+++ b/meta/classes/spdx-common.bbclass
@@ -58,7 +58,7 @@ def extract_licenses(filename):
return ascii_licenses
except Exception as e:
bb.warn(f"Exception reading {filename}: {e}")
- return None
+ return []

def is_work_shared_spdx(d):
return bb.data.inherits_class('kernel', d) or ('work-shared' in d.getVar('WORKDIR'))
--
2.43.2