exception handling in Tkinter



In wxPython I install a top-level exception handler to intercept
exceptions and display them in the GUI.

With Tkinter, I'm trying to do the same.

in __init__

sys.excepthook = self.ExceptionHandler

def ExceptionHandler(self, type, value, tb):
tblist = traceback.format_tb(tb)
for line in tblist:
text += line
self.errorDialog(text)

But it's not being called on exceptions. Any ideas?

Thanks,
Mike

.



Relevant Pages

  • Tkinter weird (and randomly inconsistant) crashes
    ... Python 2.5.1 ... TKinter version: $Revision: 50704 $ ... straight from Python the Tkinter module starts throwing exceptions. ... points (and different parts of the Tkinter code) every time. ...
    (comp.lang.python)
  • Re: Displaying messages/errors to users. Opinions?
    ... > I have been working on a few ASP.NET applications recently that access ... Likewise if an error occurs then I would like to display ... What I do is to set a couple of Session variables when I want a message to ... You don't really want the user to see the Message text of system exceptions, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Displaying messages/errors to users. Opinions?
    ... > I have been working on a few ASP.NET applications recently that access ... Likewise if an error occurs then I would like to display ... What I do is to set a couple of Session variables when I want a message to ... You don't really want the user to see the Message text of system exceptions, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: SwingWorker and exceptions in the doInBackground method
    ... throw exceptions, which I'd like to handle with error messages to the ... It's not longer advisble to create GUI in the non-EDT thread. ... For whatever method you use to perform a GUI update, simply invoke it from ...
    (comp.lang.java.programmer)
  • Re: Can u protect cells in Word as in Excel from unauthorised chan
    ... Please note that the "Exceptions " will not display until you click ... If you are using Word 2003 you could consider using the Protect Document ...
    (microsoft.public.word.tables)