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-21 23:44:08 +0100 |
commit | 81ace08c7fa717337aa46e25d6f746965a8dca1e (patch) | |
tree | c862b04f0d030d2785b483b257f2917df2ef4a45 /bitbake/lib/bb/data_smart.py | |
parent | 7e680b5e7823ac39d004c893aeaf8d439f9878cc (diff) | |
download | poky-81ace08c7fa717337aa46e25d6f746965a8dca1e.tar.gz |
bitbake: 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.
(Bitbake rev: ee26e258888114143e66330c256b5bfe7d071c53)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index ec7bb561cc..8d235da121 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -151,7 +151,7 @@ class ExpansionError(Exception): | |||
151 | self.expression = expression | 151 | self.expression = expression |
152 | self.variablename = varname | 152 | self.variablename = varname |
153 | self.exception = exception | 153 | self.exception = exception |
154 | self.varlist = [varname or expression] | 154 | self.varlist = [varname or expression or ""] |
155 | if varname: | 155 | if varname: |
156 | if expression: | 156 | if expression: |
157 | self.msg = "Failure expanding variable %s, expression was %s which triggered exception %s: %s" % (varname, expression, type(exception).__name__, exception) | 157 | 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): | |||
163 | self.args = (varname, expression, exception) | 163 | self.args = (varname, expression, exception) |
164 | 164 | ||
165 | def addVar(self, varname): | 165 | def addVar(self, varname): |
166 | self.varlist.append(varname) | 166 | if varname: |
167 | self.varlist.append(varname) | ||
167 | 168 | ||
168 | def __str__(self): | 169 | def __str__(self): |
169 | chain = "\nThe variable dependency chain for the failure is: " + " -> ".join(self.varlist) | 170 | chain = "\nThe variable dependency chain for the failure is: " + " -> ".join(self.varlist) |