From 64f88bf5d977f5aedf4fda672bba4aa165a72763 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 30 May 2012 17:17:14 +0100 Subject: 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...". (Bitbake rev: 9cb16f3c73751e7cf6d495586a6193f06eb97b1f) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 27fb7d9915..2c02cdeabf 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/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): -- cgit v1.2.3-54-g00ecf