MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / print_exception

Function print_exception

tools/python-3.11.9-amd64/Lib/cgi.py:892–904  ·  view source on GitHub ↗
(type=None, value=None, tb=None, limit=None)

Source from the content-addressed store, hash-verified

890 print_exception()
891
892def 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
906def print_environ(environ=os.environ):
907 """Dump the shell environment as HTML."""

Callers 1

testFunction · 0.70

Calls 4

format_exception_onlyMethod · 0.80
printFunction · 0.50
escapeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected