Skip to content

Commit 02bb169

Browse files
fholgerarmintaenzertng
authored andcommitted
SPDX 2 to 3 conversion should not fail if primary_package_purpose is empty
Signed-off-by: Holger Frydrych <holger.frydrych@tngtech.com>
1 parent e7df27d commit 02bb169

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/spdx_tools/spdx3/bump_from_spdx2/package.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def bump_package(
8383
elif isinstance(id_or_ref, ExternalIdentifier):
8484
external_identifier.append(id_or_ref)
8585

86-
package_purpose = SoftwarePurpose[spdx2_package.primary_package_purpose.name]
86+
package_purpose = (
87+
SoftwarePurpose[spdx2_package.primary_package_purpose.name] if spdx2_package.primary_package_purpose else None
88+
)
8789

8890
payload.add_element(
8991
Package(

0 commit comments

Comments
 (0)