Skip to content

Commit 45ecc84

Browse files
Format extracted_license_statement as YAML
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 7b2a7de commit 45ecc84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/packagedcode/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import attr
1717
from packageurl import normalize_qualifiers
1818
from packageurl import PackageURL
19+
import saneyaml
1920

2021
from commoncode import filetype
2122
from commoncode.datautils import choices
@@ -780,7 +781,7 @@ def populate_license_fields(self):
780781
)
781782

782783
if self.extracted_license_statement and not isinstance(self.extracted_license_statement, str):
783-
self.extracted_license_statement = repr(self.extracted_license_statement)
784+
self.extracted_license_statement = saneyaml.dump(self.extracted_license_statement)
784785

785786
def to_dict(self, with_details=True, **kwargs):
786787
mapping = super().to_dict(with_details=with_details, **kwargs)

0 commit comments

Comments
 (0)