diff options
author | Ed Bartosh <eduard.bartosh@intel.com> | 2016-06-10 14:58:17 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-16 11:51:07 +0100 |
commit | a9509949d7e2adba6e3cd89f97daa19a955855b5 (patch) | |
tree | 94d5b42301e3ddb4e8de52f8cbcf664764349cd5 /lib/bb/cooker.py | |
parent | 0219271d4130c1f4cf071c7577a4101c54c04921 (diff) | |
download | bitbake-contrib-a9509949d7e2adba6e3cd89f97daa19a955855b5.tar.gz |
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() < <Exception type>()
As format_exc is used in except block of handling another
exception this can cause hard to find and debug bugs.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r-- | lib/bb/cooker.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 907565401..60ee5d7c4 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -330,7 +330,7 @@ class BBCooker: f.write("%s\n" % json.dumps({"class":event.__module__ + "." + event.__class__.__name__, "vars":json.dumps(pickle.dumps(event)) })) except Exception as e: import traceback - print(e, traceback.format_exc(e)) + print(e, traceback.format_exc()) def send(self, event): |