Resurrect the excepthook, this time just sending the info with bb.fatal
(Bitbake rev: 07757a1bf1129cc6a967a7cf1815d3d46a6bbdcf) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
6c338660e8
commit
ce42c24d70
|
@ -29,6 +29,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
|
||||||
|
|
||||||
import optparse
|
import optparse
|
||||||
import warnings
|
import warnings
|
||||||
|
from traceback import format_exception
|
||||||
import bb
|
import bb
|
||||||
import bb.msg
|
import bb.msg
|
||||||
from bb import cooker
|
from bb import cooker
|
||||||
|
@ -55,6 +56,13 @@ class BBConfiguration(object):
|
||||||
self.pkgs_to_build = []
|
self.pkgs_to_build = []
|
||||||
|
|
||||||
|
|
||||||
|
def print_exception(exc, value, tb):
|
||||||
|
"""Send exception information through bb.msg"""
|
||||||
|
bb.fatal("".join(format_exception(exc, value, tb)))
|
||||||
|
|
||||||
|
sys.excepthook = print_exception
|
||||||
|
|
||||||
|
|
||||||
_warnings_showwarning = warnings.showwarning
|
_warnings_showwarning = warnings.showwarning
|
||||||
def _showwarning(message, category, filename, lineno, file=None, line=None):
|
def _showwarning(message, category, filename, lineno, file=None, line=None):
|
||||||
"""Display python warning messages using bb.msg"""
|
"""Display python warning messages using bb.msg"""
|
||||||
|
|
Loading…
Reference in New Issue