From 2f17b87f9712d0e218d656dae0037d15a019f9f6 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Mon, 11 Feb 2019 15:13:01 +0100 Subject: [PATCH] bitbake: build.py: add unhandled exception information to the logger when executing python tasks Previously this information was simply discarded, which in some cases resulted in generic, unhelpful failures. With this change the user would see what the exception is, but without ugly tracebacks or bulky, irrelevant information from the log file. (Bitbake rev: 8da9242702fbef8cf3156b95a1076802e0f653c7) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- bitbake/lib/bb/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 3e2a94edb11..7571421d71b 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -304,9 +304,10 @@ def exec_func_python(func, d, runfile, cwd=None, pythonexception=False): utils.better_exec(comp, {"d": d}, code, "exec_python_func() autogenerated", pythonexception=pythonexception) except (bb.parse.SkipRecipe, bb.build.FuncFailed): raise - except: + except Exception as e: if pythonexception: raise + logger.error(str(e)) raise FuncFailed(func, None) finally: bb.debug(2, "Python function %s finished" % func) -- 2.47.2