diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-20 18:01:51 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-20 20:44:29 +0100 |
commit | ee26e258888114143e66330c256b5bfe7d071c53 (patch) | |
tree | dfe7c0195506dd69a5a71f68c67e438e8adb7eb0 | |
parent | 9d84fd557a3fcbae2cdd70b24e69325ad737a01e (diff) | |
download | bitbake-ee26e258888114143e66330c256b5bfe7d071c53.tar.gz |
data_smart: Don't add None to ExpansionError varlist
If a "None" value gets into the varlist, it doesn't display properly.
Ensure we don't add one to have the exception display properly.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/data_smart.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index ec7bb561c..8d235da12 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -151,7 +151,7 @@ class ExpansionError(Exception): self.expression = expression self.variablename = varname self.exception = exception - self.varlist = [varname or expression] + self.varlist = [varname or expression or ""] if varname: if expression: self.msg = "Failure expanding variable %s, expression was %s which triggered exception %s: %s" % (varname, expression, type(exception).__name__, exception) @@ -163,7 +163,8 @@ class ExpansionError(Exception): self.args = (varname, expression, exception) def addVar(self, varname): - self.varlist.append(varname) + if varname: + self.varlist.append(varname) def __str__(self): chain = "\nThe variable dependency chain for the failure is: " + " -> ".join(self.varlist) |