This is a shorthand for 'print_exception(sys.last_exc, limit=limit, file=file, chain=chain)'.
(limit=None, file=None, chain=True)
| 214 | return "".join(format_exception(sys.exception(), limit=limit, chain=chain)) |
| 215 | |
| 216 | def print_last(limit=None, file=None, chain=True): |
| 217 | """This is a shorthand for 'print_exception(sys.last_exc, limit=limit, file=file, chain=chain)'.""" |
| 218 | if not hasattr(sys, "last_exc") and not hasattr(sys, "last_type"): |
| 219 | raise ValueError("no last exception") |
| 220 | |
| 221 | if hasattr(sys, "last_exc"): |
| 222 | print_exception(sys.last_exc, limit=limit, file=file, chain=chain) |
| 223 | else: |
| 224 | print_exception(sys.last_type, sys.last_value, sys.last_traceback, |
| 225 | limit=limit, file=file, chain=chain) |
| 226 | |
| 227 | |
| 228 | # |
nothing calls this directly
no test coverage detected