west: spdx: make SBOM generation compatible with Python < 3.12

Avoid f-strings with backslashes for Python < 3.12 compatibility,
which fixes SBOM generation crashes on older Python versions.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
This commit is contained in:
Patryk Koscik 2025-07-07 17:37:57 +02:00 committed by Dan Kalowsky
parent dda57865c0
commit 854e185248

View File

@ -241,7 +241,7 @@ def scanDocument(cfg, doc):
f.licenseInfoInFile = splitExpression(expression)
if copyrights := getCopyrightInfo(f.abspath):
f.copyrightText = f"<text>\n{'\n'.join(copyrights)}\n</text>"
f.copyrightText = "<text>\n" + "\n".join(copyrights) + "\n</text>"
# check if any custom license IDs should be flagged for document
for lic in f.licenseInfoInFile: