Install an handler for unhandled exceptions is not something new: there is
already sys.displayhook and sys.excepthook.

I'm not sure that it's useful to get the "default" handler. Just give
access to the current handler. So when you setup a new handler, just call
the previous if you don't know what to do with it. It is the design chosen
for the new malloc API, PEP 445. So you just need two function: get and
set.

For sys.displayhook/excepthook, the default is stored in
sys.__displayhook/excepthook__.

Victor

Reply via email to