aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/ast.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-22 13:54:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-23 09:22:44 +0100
commitce682323a918e4c59d854745865b0950610ce29b (patch)
treeb51d638ec40ed7bff8823cf70d132820c69c4a50 /bitbake/lib/bb/parse/ast.py
parent9e8ba3036d8dde69f3a67925e6c1028469220f1e (diff)
downloadopenembedded-core-contrib-ce682323a918e4c59d854745865b0950610ce29b.tar.gz
bitbake: ast: Extract text variable in PythonMethodNode
(Bitbake rev: 2e98f740b4a57a3467b1a00b1ebc1aaee33a8ff0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r--bitbake/lib/bb/parse/ast.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index b7eaff1c69..dfc0b02245 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -125,17 +125,18 @@ class MethodNode(AstNode):
self.body = body
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('/.+-', '____'))))
if not funcname in bb.methodpool._parsed_fns:
- text = "def %s(d):\n" % (funcname) + '\n'.join(self.body)
+ text = "def %s(d):\n" % (funcname) + text
bb.methodpool.insert_method(funcname, text, self.filename)
anonfuncs = data.getVar('__BBANONFUNCS') or []
anonfuncs.append(funcname)
data.setVar('__BBANONFUNCS', anonfuncs)
else:
data.setVarFlag(self.func_name, "func", 1)
- data.setVar(self.func_name, '\n'.join(self.body))
+ data.setVar(self.func_name, text)
class PythonMethodNode(AstNode):
def __init__(self, filename, lineno, function, modulename, body):