diff options
Diffstat (limited to 'bitbake/lib/bb/parse')
| -rw-r--r-- | bitbake/lib/bb/parse/ast.py | 8 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index b2657f8044..713bef1cc2 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
| @@ -148,9 +148,8 @@ class MethodNode(AstNode): | |||
| 148 | text = '\n'.join(self.body) | 148 | text = '\n'.join(self.body) |
| 149 | if self.func_name == "__anonymous": | 149 | if self.func_name == "__anonymous": |
| 150 | funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(string.maketrans('/.+-', '____')))) | 150 | funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(string.maketrans('/.+-', '____')))) |
| 151 | if not funcname in bb.methodpool._parsed_fns: | 151 | text = "def %s(d):\n" % (funcname) + text |
| 152 | text = "def %s(d):\n" % (funcname) + text | 152 | bb.methodpool.insert_method(funcname, text, self.filename) |
| 153 | bb.methodpool.insert_method(funcname, text, self.filename) | ||
| 154 | anonfuncs = data.getVar('__BBANONFUNCS') or [] | 153 | anonfuncs = data.getVar('__BBANONFUNCS') or [] |
| 155 | anonfuncs.append(funcname) | 154 | anonfuncs.append(funcname) |
| 156 | data.setVar('__BBANONFUNCS', anonfuncs) | 155 | data.setVar('__BBANONFUNCS', anonfuncs) |
| @@ -171,8 +170,7 @@ class PythonMethodNode(AstNode): | |||
| 171 | # 'this' file. This means we will not parse methods from | 170 | # 'this' file. This means we will not parse methods from |
| 172 | # bb classes twice | 171 | # bb classes twice |
| 173 | text = '\n'.join(self.body) | 172 | text = '\n'.join(self.body) |
| 174 | if not bb.methodpool.parsed_module(self.modulename): | 173 | bb.methodpool.insert_method(self.modulename, text, self.filename) |
| 175 | bb.methodpool.insert_method(self.modulename, text, self.filename) | ||
| 176 | data.setVarFlag(self.function, "func", 1) | 174 | data.setVarFlag(self.function, "func", 1) |
| 177 | data.setVarFlag(self.function, "python", 1) | 175 | data.setVarFlag(self.function, "python", 1) |
| 178 | data.setVar(self.function, text) | 176 | data.setVar(self.function, text) |
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 87a1530cb5..01f22d3b24 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
| @@ -167,10 +167,6 @@ def handle(fn, d, include): | |||
| 167 | if oldfile: | 167 | if oldfile: |
| 168 | d.setVar("FILE", oldfile) | 168 | d.setVar("FILE", oldfile) |
| 169 | 169 | ||
| 170 | # we have parsed the bb class now | ||
| 171 | if ext == ".bbclass" or ext == ".inc": | ||
| 172 | bb.methodpool.set_parsed_module(base_name) | ||
| 173 | |||
| 174 | return d | 170 | return d |
| 175 | 171 | ||
| 176 | def feeder(lineno, s, fn, root, statements): | 172 | def feeder(lineno, s, fn, root, statements): |
