[bitbake-devel] [PATCH 1/2] bb.data_smart: retain traceback from ExpansionError

Christopher Larson kergoth at gmail.com
Mon Aug 24 22:31:59 UTC 2015


From: Christopher Larson <chris_larson at mentor.com>

This gives us the needed context of the original ExpansionError, which is
invaluable when we have a chain of function calls in the expansion.

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 lib/bb/data_smart.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 26f69d1..6fac82e 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -367,7 +367,8 @@ class DataSmart(MutableMapping):
             except bb.parse.SkipRecipe:
                 raise
             except Exception as exc:
-                raise ExpansionError(varname, s, exc)
+                exc_class, exc, tb = sys.exc_info()
+                raise ExpansionError, ExpansionError(varname, s, exc), tb
 
         varparse.value = s
 
-- 
2.2.1




More information about the bitbake-devel mailing list