diff options
-rw-r--r-- | bitbake/lib/bb/exceptions.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/exceptions.py b/bitbake/lib/bb/exceptions.py index 13269de..e134ae1 100644 --- a/bitbake/lib/bb/exceptions.py +++ b/bitbake/lib/bb/exceptions.py @@ -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) |