From: Mathieu Dubois-Briand Date: Fri, 6 Dec 2024 16:51:48 +0000 (+0100) Subject: qemurunner: Fix stack trace generation in exception handler X-Git-Tag: yocto-5.2~1058 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f9ecf5f210e967594069f172728fd5b4d5b4f1d;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git qemurunner: Fix stack trace generation in exception handler Qemurunner exception handling code currently formats the stack trace using traceback.format_exception(), with parameters introduced in python 3.10. This will fail on platforms with an older python version. Change this to the old parameter order, still supported in current python versions. https://docs.python.org/3/library/traceback.html#traceback.format_exception Fixes [YOCTO #15675] Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 98a11e1a2c3..6cab9aa6b20 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -746,8 +746,10 @@ class LoggingThread(threading.Thread): def threadtarget(self): try: self.eventloop() - except Exception as e: - self.logger.warning("Exception %s in logging thread" % traceback.format_exception(e)) + except Exception: + exc_type, exc_value, exc_traceback = sys.exc_info() + self.logger.warning("Exception %s in logging thread" % + traceback.format_exception(exc_type, exc_value, exc_traceback)) finally: self.teardown()