mirror of
https://git.yoctoproject.org/poky
synced 2026-04-28 15:32:27 +02:00
bb.exceptions: add to_string convenience function
(Bitbake rev: 17a64df7e91438ee3fe1f7095c319f700a5372f1) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
22522d5f0d
commit
5b4b6bc7f7
@@ -53,3 +53,9 @@ def format_exception(etype, value, tb, context=1, limit=None, formatter=None):
|
||||
formatted.extend(format_extracted(tb, formatter, limit))
|
||||
formatted.extend(traceback.format_exception_only(etype, value))
|
||||
return formatted
|
||||
|
||||
def to_string(exc):
|
||||
if isinstance(exc, SystemExit):
|
||||
if not isinstance(exc.code, basestring):
|
||||
return 'Exited with "%d"' % exc.code
|
||||
return str(exc)
|
||||
|
||||
Reference in New Issue
Block a user