diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-05-05 19:06:35 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-08 20:38:23 +0100 |
commit | 5b4b6bc7f7b24cb02811905b065304ba6b7e6e07 (patch) | |
tree | 2c2fb3506b3342c02f0817b202ab379d48b2050f /bitbake/lib | |
parent | 22522d5f0db604674f48998bd8a057e50a70a17d (diff) | |
download | poky-5b4b6bc7f7b24cb02811905b065304ba6b7e6e07.tar.gz |
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>
Diffstat (limited to 'bitbake/lib')
-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 13269de8c1..e134ae136d 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): | |||
53 | formatted.extend(format_extracted(tb, formatter, limit)) | 53 | formatted.extend(format_extracted(tb, formatter, limit)) |
54 | formatted.extend(traceback.format_exception_only(etype, value)) | 54 | formatted.extend(traceback.format_exception_only(etype, value)) |
55 | return formatted | 55 | return formatted |
56 | |||
57 | def to_string(exc): | ||
58 | if isinstance(exc, SystemExit): | ||
59 | if not isinstance(exc.code, basestring): | ||
60 | return 'Exited with "%d"' % exc.code | ||
61 | return str(exc) | ||