From aa6894a4369dbbd032a98bfe43b285111261efa9 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Fri, 10 Jun 2016 12:34:12 +0300 Subject: bitbake: toaster: fix wrong usage of print_exc and format_exc First parameter of traceback.print_exc and traceback.format_exc APIs is a 'limit' - a number of stracktraces to print. Passing exception object to print_exc or format_exc is incorrect, but it works in Python 2 and causes printing only one line of traceback. In Python 3 comparison of integer and exception object throws exception: TypeError: unorderable types: int() < () As these APIs are usually used in except block of handling another exception this can cause hard to find and debug bugs. (Bitbake rev: c5a48931ac8db9e56f978c50861c19d0d0c808e3) Signed-off-by: Ed Bartosh Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/contrib/tts/runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/toaster/contrib/tts/runner.py') diff --git a/bitbake/lib/toaster/contrib/tts/runner.py b/bitbake/lib/toaster/contrib/tts/runner.py index bed665196e..d01386acfa 100755 --- a/bitbake/lib/toaster/contrib/tts/runner.py +++ b/bitbake/lib/toaster/contrib/tts/runner.py @@ -146,7 +146,7 @@ def execute_tests(dir_under_test, testname): except Exception as exc: import traceback - config.logger.error("Exception while running test. Tracedump: \n%s", traceback.format_exc(exc)) + config.logger.error("Exception while running test. Tracedump: \n%s", traceback.format_exc()) finally: os.chdir(crt_dir) return len(result.failures) @@ -211,7 +211,7 @@ def main(): except ShellCmdException as exc: import traceback - config.logger.error("Error while setting up testing. Traceback: \n%s", traceback.format_exc(exc)) + config.logger.error("Error while setting up testing. Traceback: \n%s", traceback.format_exc()) finally: if need_cleanup and testdir is not None: clean_up(testdir) -- cgit v1.2.3-54-g00ecf