aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-10 10:02:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-11 22:39:15 +0100
commit9eee9fd4f2f96789ad2b037e74d561bdc1426856 (patch)
treefab0404435524ff7b06b6dfc0af617a1f0b1f93d
parent30c6ff8551c235254ab90663ab88f66bb0c71edb (diff)
downloadbitbake-9eee9fd4f2f96789ad2b037e74d561bdc1426856.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 ab3344c46..9862e8878 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: