(exc_info=None, tb_indent=2)
| 16 | |
| 17 | |
| 18 | def format_exc_info(exc_info=None, tb_indent=2): |
| 19 | import traceback |
| 20 | |
| 21 | if exc_info is None: |
| 22 | exc_info = sys.exc_info() |
| 23 | |
| 24 | exc_msg = traceback.format_exception_only(exc_info[0], exc_info[1]) |
| 25 | lines = ''.join(exc_msg).rstrip('\n').split('\n') |
| 26 | |
| 27 | lines.append('Traceback (most recent call last):') |
| 28 | tb = traceback.format_tb(exc_info[2]) |
| 29 | lines.extend(''.join(tb).rstrip('\n').split('\n')) |
| 30 | |
| 31 | indent = ' ' * tb_indent |
| 32 | return '{0}'.format(('\n' + indent).join(lines)) |
| 33 | |
| 34 | |
| 35 | def get_known_environments(): |
no outgoing calls
no test coverage detected