diff options
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index a202053..d8c141b 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -139,6 +139,8 @@ class DataNode(AstNode): data.setVar(key, val, **loginfo) class MethodNode(AstNode): + tr_tbl = string.maketrans('/.+-@%', '______') + def __init__(self, filename, lineno, func_name, body): AstNode.__init__(self, filename, lineno) self.func_name = func_name @@ -147,7 +149,7 @@ class MethodNode(AstNode): def eval(self, data): text = '\n'.join(self.body) if self.func_name == "__anonymous": - funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(string.maketrans('/.+-@', '_____')))) + funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(MethodNode.tr_tbl))) text = "def %s(d):\n" % (funcname) + text bb.methodpool.insert_method(funcname, text, self.filename) anonfuncs = data.getVar('__BBANONFUNCS') or [] |