mirror of
https://git.yoctoproject.org/poky
synced 2026-09-16 09:49:35 +02:00
codeparser: accept a name for better messages
- If a name is passed to the parser, prepend the messages with "while
parsing <name>:". 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 <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
48d7f5251b
commit
ae96ac1189
@@ -68,7 +68,7 @@ class VariableParse:
|
||||
code = match.group()[3:-1]
|
||||
codeobj = compile(code.strip(), self.varname or "<expansion>", "eval")
|
||||
|
||||
parser = bb.codeparser.PythonParser()
|
||||
parser = bb.codeparser.PythonParser(self.varname)
|
||||
parser.parse_python(code)
|
||||
self.references |= parser.references
|
||||
self.execs |= parser.execs
|
||||
|
||||
Reference in New Issue
Block a user