diff mbox series

[scarthgap,6/8] license.py: avoid deprecated ast.Str

Message ID df9898f13c261eeac2cc343569c843bc7dcaf163.1758139278.git.steve@sakoman.com
State RFC
Delegated to: Steve Sakoman
Headers show
Series [scarthgap,1/8] wpa-supplicant: fix CVE-2022-37660 | expand

Commit Message

Steve Sakoman Sept. 17, 2025, 8:04 p.m. UTC
From: Martin Jansa <martin.jansa@gmail.com>

* it's deprecated since python-3.12 and removed in 3.14 causing:

openembedded-core/meta/lib/oe/license.py', lineno: 176, function: visit
     0172:
     0173:        LicenseVisitor.__init__(self)
     0174:
     0175:    def visit(self, node):
 *** 0176:        if isinstance(node, ast.Str):
     0177:            lic = node.s
     0178:
     0179:            if license_ok(self._canonical_license(self._d, lic),
     0180:                    self._dont_want_licenses) == True:
Exception: AttributeError: module 'ast' has no attribute 'Str'

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/lib/oe/license.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index d9c8d94da4..ac5b296e60 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -172,8 +172,8 @@  class ManifestVisitor(LicenseVisitor):
         LicenseVisitor.__init__(self)
 
     def visit(self, node):
-        if isinstance(node, ast.Str):
-            lic = node.s
+        if isinstance(node, ast.Constant):
+            lic = node.value
 
             if license_ok(self._canonical_license(self._d, lic),
                     self._dont_want_licenses) == True: