[yocto] [patchtest][PATCH 1/2] patchtest: Fix printing of exception tracebacks

Paul Barker paul at betafive.co.uk
Fri Nov 15 05:23:23 PST 2019


The addError() handler is called outside of an actual exception handler
so sys.exc_info() doesn't actually return an exception. This means that
traceback.print_exc() doesn't know what to print. Instead we need to use
traceback.print_exception() with the err object we've been given.

Signed-off-by: Paul Barker <paul at betafive.co.uk>
---
 patchtest | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/patchtest b/patchtest
index 592f73e..59b19f5 100755
--- a/patchtest
+++ b/patchtest
@@ -101,8 +101,7 @@ def getResult(patch, mergepatch):
 
         def addError(self, test, err):
             self.test_error = True
-            (ty, va, trace) = err
-            logger.error(traceback.print_exc())
+            logger.error(traceback.print_exception(*err))
 
         def addFailure(self, test, err):
             self.test_failure = True
-- 
2.17.1



More information about the yocto mailing list