MCPcopy
hub / github.com/davidhalter/jedi-vim / format_exc_info

Function format_exc_info

pythonx/jedi_vim_debug.py:18–32  ·  view source on GitHub ↗
(exc_info=None, tb_indent=2)

Source from the content-addressed store, hash-verified

16
17
18def 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
35def get_known_environments():

Callers 1

display_debug_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected