pynvim icon indicating copy to clipboard operation
pynvim copied to clipboard

Overriding sys.excepthook does not work

Open tbabej opened this issue 9 years ago • 0 comments

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

  1. 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!")

tbabej avatar Dec 21 '16 02:12 tbabej