diff options
Diffstat (limited to 'bitbake')
-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 a2020532ea..d8c141b37c 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -139,6 +139,8 @@ class DataNode(AstNode): | |||
139 | data.setVar(key, val, **loginfo) | 139 | data.setVar(key, val, **loginfo) |
140 | 140 | ||
141 | class MethodNode(AstNode): | 141 | class MethodNode(AstNode): |
142 | tr_tbl = string.maketrans('/.+-@%', '______') | ||
143 | |||
142 | def __init__(self, filename, lineno, func_name, body): | 144 | def __init__(self, filename, lineno, func_name, body): |
143 | AstNode.__init__(self, filename, lineno) | 145 | AstNode.__init__(self, filename, lineno) |
144 | self.func_name = func_name | 146 | self.func_name = func_name |
@@ -147,7 +149,7 @@ class MethodNode(AstNode): | |||
147 | def eval(self, data): | 149 | def eval(self, data): |
148 | text = '\n'.join(self.body) | 150 | text = '\n'.join(self.body) |
149 | if self.func_name == "__anonymous": | 151 | if self.func_name == "__anonymous": |
150 | funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(string.maketrans('/.+-@', '_____')))) | 152 | funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(MethodNode.tr_tbl))) |
151 | text = "def %s(d):\n" % (funcname) + text | 153 | text = "def %s(d):\n" % (funcname) + text |
152 | bb.methodpool.insert_method(funcname, text, self.filename) | 154 | bb.methodpool.insert_method(funcname, text, self.filename) |
153 | anonfuncs = data.getVar('__BBANONFUNCS') or [] | 155 | anonfuncs = data.getVar('__BBANONFUNCS') or [] |