Quoting Harry Henry Gebel <[EMAIL PROTECTED]>:

> > > How do I stop mainloop from catching exceptions?
> > Set the PYGTK_FATAL_EXCEPTIONS environment variable before running
> > your
> If I set this environment variable in the program prior to importing
> gtk,
> gnome.ui, and libglade will it still work? My intention is to put
> mainloop
> in a try clause and put up a GnomeErrorDialog with a traceback, append
> the
> traceback to a log file, then call mainloop again to continue with the
> program (hoping that you can run mainloop again after an uncaught
> exception
> like you can after mainquit). I would like this to be a standard
> function
> of the program, which is why I would like to set it in the program
> (Although if it can't I can always wrap the program in a shell script
> too.)

Try this:

   import sys
   sys.stderr.close ()
   sys.stderr = open ('error.log', 'w')

That should do it :-) (The mainloop() doesn't exit on an exception and
since all exceptions will be logged to stdout, they will end up in the
file).

Python: Simple by design.

-- 
==============================================
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, [EMAIL PROTECTED]
==============================================


-------------------------------------------------
This mail sent through IMP: www.hepe.com
-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to