MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _exception_traceback

Function _exception_traceback

tools/python-3.11.9-amd64/Lib/doctest.py:244–253  ·  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

242 return re.sub('(?m)^(?!$)', indent*' ', s)
243
244def _exception_traceback(exc_info):
245 """
246 Return a string containing a traceback message for the given
247 exc_info tuple (as returned by sys.exc_info()).
248 """
249 # Get a traceback message.
250 excout = StringIO()
251 exc_type, exc_val, exc_tb = exc_info
252 traceback.print_exception(exc_type, exc_val, exc_tb, file=excout)
253 return excout.getvalue()
254
255# Override some StringIO methods.
256class _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