pynvim
pynvim copied to clipboard
Overriding sys.excepthook does not work
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__ import print_function
import sys
def customhook(x,y,z):
"""
My custom excepthook
"""
print("Exception happened!")
sys.excepthook = customhook
2, Raise an exception
:py3 raise Exception("No traceback please!")