From: Richard Purdie Date: Thu, 12 May 2016 07:22:52 +0000 (+0100) Subject: data_smart: Simplify ExpansionError exception X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b19a4c5166303b1fa680582adf63e6a5564bfb4c;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git data_smart: Simplify ExpansionError exception This seemingly convoluted syntax doesn't work in python3. Instead use the chained exception handling syntax which appears to make more sense here. Signed-off-by: Richard Purdie --- diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index 2a61386d897..25c412c1ad0 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -397,8 +397,7 @@ class DataSmart(MutableMapping): except bb.parse.SkipRecipe: raise except Exception as exc: - exc_class, exc, tb = sys.exc_info() - raise ExpansionError, ExpansionError(varname, s, exc), tb + raise ExpansionError(varname, s, exc) from exc varparse.value = s