On Wed, Nov 12, 2003 at 09:38:36AM -1000, Tim Newsham wrote:
> 
> Hi,  When an exception happens within a gtk callback, it seems to
> get handled (by printing a stack trace) internally without propagating
> up to the top level and stopping the program.  This behavior has
> been very useful for debugging, but now I want to be able to catch
> these exceptions and display the error message in a more appropriate
> manner (for example, the program is often run in windows in which
> there is no console window to display the exception information).
> Is there some way to hook into the error handling code?

  Yes, there is -- you need to override "sys.excepthook" with 
a function that does what you want.  This is actually FAQ 20.10
(search for "excepthook" at www.async.com.br/faq/pygtk/), but it's
reasonably straightforward to figure out from just reading the 
Python "excepthook" docs.

                                -- A.
-- 
Dr. Andrew C. E. Reid, Guest Researcher 
Center for Theoretical and Computational Materials Science
National Institute of Standards and Technology, Mail Stop 8500
Gaithersburg MD 20899 USA
[EMAIL PROTECTED]
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to