This is a shorthand for 'print_exception(sys.last_exc, limit=limit, file=file, chain=chain)'.
(limit=None, file=None, chain=True)
| 224 | return "".join(format_exception(sys.exception(), limit=limit, chain=chain)) |
| 225 | |
| 226 | def 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 | # |
nothing calls this directly
no test coverage detected
searching dependent graphs…