* [PATCH] codeparser: Allow empty functions
@ 2015-06-26 16:23 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-06-26 16:23 UTC (permalink / raw)
To: bitbake-devel
The main parser and other code copes with empty python functions but
the python codeparser does not. Fix this to avoid errors with code like:
python do_build () {
}
which currently results in the obtuse:
"Failure expanding variable do_build: IndexError: string index out of range"
[YOCTO #7829]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 2d3574c..82a3af4 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -245,6 +245,9 @@ class PythonParser():
self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message)
def parse_python(self, node):
+ if not node or not node.strip():
+ return
+
h = hash(str(node))
if h in codeparsercache.pythoncache:
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-26 16:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-26 16:23 [PATCH] codeparser: Allow empty functions Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.