cannot override sys.excepthook

前端 未结 4 862
星月不相逢
星月不相逢 2020-12-02 00:02

I try to customize behavior of sys.excepthook as described by the recipe.

in ipython:

:import pdb, sys, traceback
:def info(type, value         


        
4条回答
  •  星月不相逢
    2020-12-02 00:36

    ipython, which you're using instead of the normal Python interactive shell, traps all exceptions itself and does NOT use sys.excepthook. Run it as ipython -pdb instead of just ipython, and it will automatically invoke pdb upon uncaught exceptions, just as you are trying to do with your excepthook.

提交回复
热议问题