* [PATCH] data_smart: Don't add None to ExpansionError varlist
@ 2021-09-20 19:45 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2021-09-20 19:45 UTC (permalink / raw)
To: bitbake-devel
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>
---
lib/bb/data_smart.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index ec7bb561cc..8d235da121 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)
--
2.32.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-20 19:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 19:45 [PATCH] data_smart: Don't add None to ExpansionError varlist Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).