]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
qemurunner: Fix stack trace generation in exception handler
authorMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Fri, 6 Dec 2024 16:51:48 +0000 (17:51 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 Dec 2024 09:17:50 +0000 (09:17 +0000)
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 <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/qemurunner.py

index 98a11e1a2c3c0d9e1ecfd90068f2af4a1447f098..6cab9aa6b202271f7adaf63ced1a095e89d6b8ef 100644 (file)
@@ -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()