All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] utils: Ensure shell function failure in python logging is correct
@ 2022-02-21 16:03 Richard Purdie
  2022-03-08 10:39 ` [bitbake-devel] " Peter Kjellerstedt
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2022-02-21 16:03 UTC (permalink / raw)
  To: bitbake-devel

If a python function exec_func() calls a shell task, the logging wasn't working
correctly in all cases since the exception was turned into a BBHandledException()
and the logfile piece was lost which is handled at the top task level.

The easiest way to avoid this is to allow the ExecutionError exceptions to
be raised to a higher level, we don't need the traceback for them.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 2c22535424..2e8256101a 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -402,7 +402,7 @@ def better_exec(code, context, text = None, realfile = "<code>", pythonexception
         code = better_compile(code, realfile, realfile)
     try:
         exec(code, get_context(), context)
-    except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError):
+    except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError, bb.process.ExecutionError):
         # Error already shown so passthrough, no need for traceback
         raise
     except Exception as e:
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-08 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21 16:03 [PATCH] utils: Ensure shell function failure in python logging is correct Richard Purdie
2022-03-08 10:39 ` [bitbake-devel] " Peter Kjellerstedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.