]> code.ossystems Code Review - openembedded-core.git/commitdiff
license.bbclass: implement ast.NodeVisitor.visit_Constant
authorRoss Burton <ross@burtonini.com>
Wed, 13 Oct 2021 15:10:24 +0000 (16:10 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Oct 2021 21:31:56 +0000 (22:31 +0100)
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 <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license.bbclass

index 45d912741d27db4edd664624d2879b0e4759ef6e..7a34e185c74ad35a4b1491a87d4f1950b67d01ed 100644 (file)
@@ -145,6 +145,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)