[wingide-users] Using sys.excepthook in my code

Wingware Support support at wingware.com
Wed Aug 27 08:35:34 MDT 2008

Tony Cappellini wrote:
> If I assign a function to sys.excepthook in my code, will this cause any 
> problems with Wing?
> I haven't used sys.excepthook before, I want to make sure I'm not 
> setting myself up for problems when I start debugging.

In general and with Wing, you should call the original sys.excepthook 
from your function.  e.g.

orig_except_hook = None
def my_hook(etype, evalue, tb):
   if orig_except_hook is not None:
     orig_except_hook(etype, evalue, tb)
orig_except_hook = sys.excepthook
sys.excepthook = my_hook



More information about the wingide-users mailing list