From ae96ac11897c1017aea359a8e3325291bc198293 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 28 Oct 2011 21:32:26 -0400 Subject: codeparser: accept a name for better messages - If a name is passed to the parser, prepend the messages with "while parsing :". This gives a bit more context. - Tweak the warning messages slightly (they had to be altered anyway to inject the variable being parsed). Before: DEBUG: Warning: in call to 'bb.data.getVar': argument ''%s' % var' is \ not a literal After: DEBUG: while parsing emit_pkgdata, in call of bb.data.getVar, argument \ ''%s' % var' is not a string literal (Bitbake rev: 1060193ae4d54e667735dbff5d1d2be49a3f95c9) Signed-off-by: Christopher Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake/lib/bb/data_smart.py') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index d8ba24ffd7..44369ed82d 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -68,7 +68,7 @@ class VariableParse: code = match.group()[3:-1] codeobj = compile(code.strip(), self.varname or "", "eval") - parser = bb.codeparser.PythonParser() + parser = bb.codeparser.PythonParser(self.varname) parser.parse_python(code) self.references |= parser.references self.execs |= parser.execs -- cgit v1.2.3-54-g00ecf