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

Function print_last

Lib/traceback.py:226–235  ·  view source on GitHub ↗

This is a shorthand for 'print_exception(sys.last_exc, limit=limit, file=file, chain=chain)'.

(limit=None, file=None, chain=True)

Source from the content-addressed store, hash-verified

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)'."""
228 if not hasattr(sys, "last_exc") and not hasattr(sys, "last_type"):
229 raise ValueError("no last exception")
230
231 if hasattr(sys, "last_exc"):
232 print_exception(sys.last_exc, limit=limit, file=file, chain=chain)
233 else:
234 print_exception(sys.last_type, sys.last_value, sys.last_traceback,
235 limit=limit, file=file, chain=chain)
236
237
238#

Callers

nothing calls this directly

Calls 1

print_exceptionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…