aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-10 10:02:08 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2022-03-03 08:22:20 +0100
commit5373336a9667420a553c467d3de4fedf964a0c85 (patch)
tree7fba0afda7cf7ffb509ad66b9ec01af188b6a0e3
parent3b61472b07896c7afcd21ff2e1dae9219aa4dad8 (diff)
downloadbitbake-contrib-5373336a9667420a553c467d3de4fedf964a0c85.tar.gz
build: Handle SystemExit in python tasks correctly
If a python task fails with sys.exit(), we currently see no TaskFailed event. The high level code does detect the exit code and fail the task but it can leave the UI inconsistent with log output. Fix this be intercepting SystemExit explicitly. This makes python task failures consistent with shell task failures. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/build.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 3f04f9f3f..579d5ae27 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -694,7 +694,7 @@ def _exec_task(fn, task, d, quieterr):
except bb.BBHandledException:
event.fire(TaskFailed(task, fn, logfn, localdata, True), localdata)
return 1
- except Exception as exc:
+ except (Exception, SystemExit) as exc:
if quieterr:
event.fire(TaskFailedSilent(task, fn, logfn, localdata), localdata)
else: