mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-01 13:58:04 +00:00
bitbake: codegen: 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. (Bitbake rev: 4edd5767fc6d699f5262862b763b6a99ad1f1bbf) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
bd5a07fbcb
commit
ca8ef6bc38
|
|
@ -401,6 +401,12 @@ class SourceGenerator(NodeVisitor):
|
|||
def visit_Num(self, node):
|
||||
self.write(repr(node.n))
|
||||
|
||||
def visit_Constant(self, node):
|
||||
# Python 3.8 deprecated visit_Num(), visit_Str(), visit_Bytes(),
|
||||
# visit_NameConstant() and visit_Ellipsis(). They can be removed once we
|
||||
# require 3.8+.
|
||||
self.write(repr(node.value))
|
||||
|
||||
def visit_Tuple(self, node):
|
||||
self.write('(')
|
||||
idx = -1
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user