[elbe-devel] [PATCH] elbepack: properly construct LicenseParagraph

Thomas Weißschuh thomas.weissschuh at linutronix.de
Mon Feb 12 12:55:18 CET 2024


The normal constructor of LicenseParagraph expects pre-parsed data.
Newer versions of python-debian (as packaged in bookworm) enforce this.
Switch to the correct construction-chain for LicenseParagraph.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/licencexml.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elbepack/licencexml.py b/elbepack/licencexml.py
index 92b70edf8b7b..d98def15ecde 100644
--- a/elbepack/licencexml.py
+++ b/elbepack/licencexml.py
@@ -10,6 +10,7 @@ import warnings
 
 from debian.copyright import (
     Copyright,
+    License,
     LicenseParagraph,
     MachineReadableFormatError,
     NotMachineReadableError,
@@ -29,8 +30,7 @@ def do_heuristics(fp):
         if lic.startswith('License:'):
             num_licenses += 1
             _, v = lic.split(':', 1)
-            data = {'License': v.strip()}
-            lic_para = LicenseParagraph(data)
+            lic_para = LicenseParagraph.create(License(v.strip()))
             c.add_license_paragraph(lic_para)
 
     if num_licenses > 0:
-- 
2.43.1



More information about the elbe-devel mailing list