summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-05-30 17:17:14 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 17:21:00 +0100
commit9cb16f3c73751e7cf6d495586a6193f06eb97b1f (patch)
tree189be9eea3cb9831179a3bc1b1eee4e43b28aba5 /lib/bb/data_smart.py
parent24b631acdaa143a4de39c6e1328849660c66f219 (diff)
downloadbitbake-contrib-9cb16f3c73751e7cf6d495586a6193f06eb97b1f.tar.gz
lib/bb/data_smart.py: don't report variable in ExpansionError if not set
If the variable name is not specified then don't confuse the error message by starting off with "Failure expanding variable None...". Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 27fb7d991..2c02cdeab 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -102,7 +102,10 @@ class ExpansionError(Exception):
self.expression = expression
self.variablename = varname
self.exception = exception
- self.msg = "Failure expanding variable %s, expression was %s which triggered exception %s: %s" % (varname, expression, type(exception).__name__, exception)
+ if varname:
+ self.msg = "Failure expanding variable %s, expression was %s which triggered exception %s: %s" % (varname, expression, type(exception).__name__, exception)
+ else:
+ self.msg = "Failure expanding expression %s which triggered exception %s: %s" % (expression, type(exception).__name__, exception)
Exception.__init__(self, self.msg)
self.args = (varname, expression, exception)
def __str__(self):