From: Ross Burton Date: Wed, 13 Oct 2021 15:10:24 +0000 (+0100) Subject: license.bbclass: implement ast.NodeVisitor.visit_Constant X-Git-Tag: yocto-3.1.12~37 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=d91fe6ecb9fbb410b3bab6ced66b7fe5f869cf83;p=openembedded-core.git license.bbclass: implement ast.NodeVisitor.visit_Constant Since Python 3.8 visit_Num(), visit_Str() and so on are all deprecated and replaced with visit_Constant. We can't yet remove the deprecated functions until we require 3.8, but we can implement visit_Constant to silence the deprecation warnings. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie (cherry picked from commit 875a944392a3c93f40081a14af357f70b6b8264f) Signed-off-by: Steve Sakoman --- diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 73f99e87a8..6b03221c7f 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -153,6 +153,10 @@ def find_license_files(d): find_license(node.s.replace("+", "").replace("*", "")) self.generic_visit(node) + def visit_Constant(self, node): + find_license(node.value.replace("+", "").replace("*", "")) + self.generic_visit(node) + def find_license(license_type): try: bb.utils.mkdirhier(gen_lic_dest)