diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-26 17:23:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-27 22:51:11 +0100 |
commit | e4f594c670189e04d58ce7d160fc1d86123620af (patch) | |
tree | 3fddcb5f60b22444ba9d26321336a0b959a6bf02 | |
parent | 378647281ae883dd726f1e1b775dd35ef6a0e8d1 (diff) | |
download | bitbake-e4f594c670189e04d58ce7d160fc1d86123620af.tar.gz |
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]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/codeparser.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/codeparser.py b/lib/bb/codeparser.py index 21a36f64c..269016ee8 100644 --- a/lib/bb/codeparser.py +++ b/lib/bb/codeparser.py @@ -240,6 +240,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: |