Sfoglia il codice sorgente

bitbake: parse/ast: Substitute '~' when naming anonymous functions

When parsing an anonymous python function, bitbake generates a name for
the function based on the full path to the file in which it was found.
As not all characters which are valid in file paths are valid in Python
function names we have a translation table. However, this translation
table was missing an entry for '~'.

(Bitbake rev: b201c0b284e25c20685d9d206797c4cc650eeca0)

Signed-off-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Paul Barker 3 anni fa
parent
commit
261da52339
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      bitbake/lib/bb/parse/ast.py

+ 1 - 1
bitbake/lib/bb/parse/ast.py

@@ -146,7 +146,7 @@ class DataNode(AstNode):
             data.setVar(key, val, parsing=True, **loginfo)
 
 class MethodNode(AstNode):
-    tr_tbl = str.maketrans('/.+-@%&', '_______')
+    tr_tbl = str.maketrans('/.+-@%&~', '________')
 
     def __init__(self, filename, lineno, func_name, body, python, fakeroot):
         AstNode.__init__(self, filename, lineno)