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

Function format_exc

Lib/traceback.py:222–224  ·  view source on GitHub ↗

Like print_exc() but return a string.

(limit=None, chain=True)

Source from the content-addressed store, hash-verified

220 print_exception(sys.exception(), limit=limit, file=file, chain=chain, **kwargs)
221
222def format_exc(limit=None, chain=True):
223 """Like print_exc() but return a string."""
224 return "".join(format_exception(sys.exception(), limit=limit, chain=chain))
225
226def print_last(limit=None, file=None, chain=True):
227 """This is a shorthand for 'print_exception(sys.last_exc, limit=limit, file=file, chain=chain)'."""

Callers 2

_handle_requestMethod · 0.90
serve_clientMethod · 0.90

Calls 3

format_exceptionFunction · 0.85
joinMethod · 0.45
exceptionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…