aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-10 10:02:08 +0100
committerSteve Sakoman <steve@sakoman.com>2021-09-24 12:38:18 -1000
commit8dec1a58ff176b82006a084537156f65ad81def9 (patch)
tree0c9d54aa624a87cca6e06cbe95b23eb6f8f7d310
parent7919f1f94e15bb5d3d124062bdcfdbe44aceb81a (diff)
downloadbitbake-contrib-8dec1a58ff176b82006a084537156f65ad81def9.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> (cherry picked from commit 9eee9fd4f2f96789ad2b037e74d561bdc1426856) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-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 fa22a1b47..04971636f 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -587,7 +587,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: