[pygtk] How to stop mainloop from catching exceptions
Aaron Optimizer Digulla
digulla@hepe.com
Thu, 20 Jul 2000 17:02:06 +0200
Quoting James Henstridge <james@daa.com.au>:
> On Thu, 25 May 2000, Harry Henry Gebel wrote:
>
> > How do I stop mainloop from catching exceptions?
> >
>
> Set the PYGTK_FATAL_EXCEPTIONS environment variable before running your
> application. This way, when an exception occurs, the main loop will be
> exited (recursively if necessary).
You can also use this code *before* you import gtk:
import os
os.environ['PYGTK_FATAL_EXCEPTIONS'] = '1'
(for some reason, os.putenv() doesn't work).
I'm currently working on a patch for pygtk-0.6.5 which will call
a user-callback in case of an error. That would allow to open a
window with a trace instead of silently dying.
--
==============================================
Sowatec AG, CH-8330 Pfäffikon (ZH)
Witzbergstr. 7, http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================