MCPcopy Index your code
hub / github.com/python/cpython / _exception_traceback

Function _exception_traceback

Lib/doctest.py:265–274  ·  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

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

Callers 2

__runMethod · 0.85

Calls 2

getvalueMethod · 0.95
StringIOClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…