MCPcopy Index your code
hub / github.com/RustPython/RustPython / _exception_traceback

Function _exception_traceback

Lib/doctest.py:271–280  ·  view source on GitHub ↗

Return a string containing a traceback message for the given exc_info tuple (as returned by sys.exc_info()).

(exc_info)

Source from the content-addressed store, hash-verified

269 return re.sub('(?m)^(?!$)', indent*' ', s)
270
271def _exception_traceback(exc_info):
272 """
273 Return a string containing a traceback message for the given
274 exc_info tuple (as returned by sys.exc_info()).
275 """
276 # Get a traceback message.
277 excout = StringIO()
278 exc_type, exc_val, exc_tb = exc_info
279 traceback.print_exception(exc_type, exc_val, exc_tb, file=excout)
280 return excout.getvalue()
281
282# Override some StringIO methods.
283class _SpoofOut(StringIO):

Callers 2

__runMethod · 0.85

Calls 3

getvalueMethod · 0.95
StringIOClass · 0.90
print_exceptionMethod · 0.80

Tested by

no test coverage detected