You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicitly overriding sys.excepthook with your custom function does not work (sys.excepthook does contain the correct function object, but for some reason it never gets called). A regular traceback is displayed instead.
How to test
Override sys.excepthook
:py3file test.py
where test.py contains:
from __future__ importprint_functionimportsysdefcustomhook(x,y,z):
""" My custom excepthook """print("Exception happened!")
sys.excepthook=customhook
2, Raise an exception
:py3 raise Exception("No traceback please!")
The text was updated successfully, but these errors were encountered:
Explicitly overriding sys.excepthook with your custom function does not work (sys.excepthook does contain the correct function object, but for some reason it never gets called). A regular traceback is displayed instead.
How to test
where test.py contains:
2, Raise an exception
The text was updated successfully, but these errors were encountered: