(type=None, value=None, tb=None, limit=None)
| 890 | print_exception() |
| 891 | |
| 892 | def print_exception(type=None, value=None, tb=None, limit=None): |
| 893 | if type is None: |
| 894 | type, value, tb = sys.exc_info() |
| 895 | import traceback |
| 896 | print() |
| 897 | print("<H3>Traceback (most recent call last):</H3>") |
| 898 | list = traceback.format_tb(tb, limit) + \ |
| 899 | traceback.format_exception_only(type, value) |
| 900 | print("<PRE>%s<B>%s</B></PRE>" % ( |
| 901 | html.escape("".join(list[:-1])), |
| 902 | html.escape(list[-1]), |
| 903 | )) |
| 904 | del tb |
| 905 | |
| 906 | def print_environ(environ=os.environ): |
| 907 | """Dump the shell environment as HTML.""" |
no test coverage detected