Skip to content

Commit 5c7c4a8

Browse files
committed
fixup! adapt code to new spdx-tools release
Signed-off-by: Meret Behrens <[email protected]>
1 parent a000d7c commit 5c7c4a8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/formattedcode/output_spdx.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
from io import BytesIO
1313
from io import StringIO
1414

15-
from spdx.checksum import Checksum, ChecksumAlgorithm
15+
from spdx.checksum import Checksum
16+
from spdx.checksum import ChecksumAlgorithm
1617
from spdx.creationinfo import Tool
1718
from spdx.document import ExtractedLicense
1819
from spdx.document import Document
@@ -359,10 +360,10 @@ def write_spdx(
359360
file_entry.copyright = SPDXNone()
360361

361362
doc.add_file(file_entry)
362-
relationship = Relationship(package.spdx_id + " CONTAINS " + file_entry.spdx_id)
363+
relationship = Relationship(f'{package.spdx_id} CONTAINS {file_entry.spdx_id}')
363364
doc.add_relationship(relationship)
364365

365-
if len(doc.files) == 0:
366+
if not doc.files:
366367
if as_tagvalue:
367368
msg = "# No results for package '{}'.\n".format(package.name)
368369
else:

0 commit comments

Comments
 (0)