[TxMt] PyMate ignores first exception

Daniel Link no.promiscuity at googlemail.com
Tue Dec 11 07:16:11 UTC 2007


Hi,

I started using wxPython lately and am a little surprised by PyMate's  
reaction to exceptions. Try this:

> #!/usr/bin/env python
> import wx
>
> def OnRaiseException(e):
>     raise "See?"
>
> app = wx.PySimpleApp()
> frame = wx.Frame(None, wx.ID_ANY, "Hello World")
>
> button = wx.Button(frame, 100, "Raise Exception")
> wx.EVT_BUTTON(button, 100, OnRaiseException)
>
> frame.Show(True)
> app.MainLoop()


Only on the second button click the traceback reaches PyMate:

> Error in sys.excepthook:
> Traceback (most recent call last):
>   method tm_excepthook in sitecustomize.py at line 66
>     io = fdopen(error_fd, 'w')
> OSError: [Errno 9] Bad file descriptor
>
> Original exception was:
> Traceback (most recent call last):
>   method OnRaiseException in test.py at line 5
>     raise "See?"
> See?


Perhaps someone can tell me whether this is a bug or a feature.

Regards,

   Daniel



More information about the textmate mailing list