From 772e9b4eabf054cadb8ad2dc6b223aa6c30c7f46 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Fri, 10 Jun 2016 14:58:17 +0300 Subject: bitbake: bitbake: fix wrong usage of format_exc First parameter of traceback.format_exc is a 'limit' - a number of stracktraces to format. Passing exception object to format_exc is incorrect, but it works in Python 2 as this code from traceback module works: while tb is not None and (limit is None or n < limit): Comparing integer counter n with the exception object in Python 2 always results in True. However, in Python 3 it throws exception: TypeError: unorderable types: int() < () As format_exc is used in except block of handling another exception this can cause hard to find and debug bugs. (Bitbake rev: a9509949d7e2adba6e3cd89f97daa19a955855b5) Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/uievent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake/lib/bb/ui') diff --git a/bitbake/lib/bb/ui/uievent.py b/bitbake/lib/bb/ui/uievent.py index ca1916664d..9542b911ca 100644 --- a/bitbake/lib/bb/ui/uievent.py +++ b/bitbake/lib/bb/ui/uievent.py @@ -116,7 +116,7 @@ class BBUIEventQueue: self.server.handle_request() except Exception as e: import traceback - logger.error("BBUIEventQueue.startCallbackHandler: Exception while trying to handle request: %s\n%s" % (e, traceback.format_exc(e))) + logger.error("BBUIEventQueue.startCallbackHandler: Exception while trying to handle request: %s\n%s" % (e, traceback.format_exc())) self.server.server_close() -- cgit v1.2.3-54-g00ecf