From c2b40b0f6d062c5061b11b038fac3b7b1539c688 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 10 Sep 2021 10:02:08 +0100 Subject: bitbake: 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. (Bitbake rev: 9eee9fd4f2f96789ad2b037e74d561bdc1426856) Signed-off-by: Richard Purdie --- bitbake/lib/bb/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake/lib/bb/build.py') diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index ab3344c460..9862e8878e 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/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: -- cgit v1.2.3-54-g00ecf