From 854e1852489b5bd8beb9ee26242f69af4141ef95 Mon Sep 17 00:00:00 2001 From: Patryk Koscik Date: Mon, 7 Jul 2025 17:37:57 +0200 Subject: [PATCH] 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 --- scripts/west_commands/zspdx/scanner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/zspdx/scanner.py b/scripts/west_commands/zspdx/scanner.py index 93c43095598..521893d3445 100644 --- a/scripts/west_commands/zspdx/scanner.py +++ b/scripts/west_commands/zspdx/scanner.py @@ -241,7 +241,7 @@ def scanDocument(cfg, doc): f.licenseInfoInFile = splitExpression(expression) if copyrights := getCopyrightInfo(f.abspath): - f.copyrightText = f"\n{'\n'.join(copyrights)}\n" + f.copyrightText = "\n" + "\n".join(copyrights) + "\n" # check if any custom license IDs should be flagged for document for lic in f.licenseInfoInFile: