On this page
  1. sys.excepthook
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

sys.excepthook

Prev: sys.exc_info | Up: sys | Next: sys.exception
Rel: sys.activate_stack_trampoline, sys.addaudithook, sys.audit, sys.breakpointhook
Ref: docs.python.org — sys.excepthook
Tags: #public #python3 #stdlib #sys


Import

import sys
from sys import excepthook

Signature & Overview

sys.excepthook(exctype, value, traceback, /)

Handle an exception by displaying it with a traceback on sys.stderr.

Usage

import sys

# Default top-level handler for uncaught exceptions on the main thread
assert callable(sys.excepthook)

Gotchas

REPL Inspect

from sys import excepthook
help(excepthook)

Linked from

Related notes