summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-26 17:23:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-27 22:51:20 +0100
commitdcbbe545bf5dbd34c8e2f934a33e59e5d38843cc (patch)
tree50e9ab9e53158c3bcd9af3737e0d382c05d61b6a /bitbake
parent43c6e8c0dd7a7139b476b94d69a0252c639393bf (diff)
downloadpoky-dcbbe545bf5dbd34c8e2f934a33e59e5d38843cc.tar.gz
bitbake: codeparser: Allow empty functions
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] (Bitbake rev: e4f594c670189e04d58ce7d160fc1d86123620af) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/codeparser.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 21a36f64ca..269016ee89 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -240,6 +240,9 @@ class PythonParser():
240 self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message) 240 self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message)
241 241
242 def parse_python(self, node): 242 def parse_python(self, node):
243 if not node or not node.strip():
244 return
245
243 h = hash(str(node)) 246 h = hash(str(node))
244 247
245 if h in codeparsercache.pythoncache: 248 if h in codeparsercache.pythoncache: