[PyQt] catching exceptions and PyQt

Wim Verhavert wim.verhavert at gmail.com
Thu Sep 18 11:48:18 BST 2008


I'm not an expert on this but I have done something like this in the past:

def excepthook(excType, excValue, tracebackobj):
    # do here the things you want when an uncaught exception occurs
    pass

if __name__=='__main__':
    # put this in your main
    sys.excepthook = excepthook

I think I got the idea from the eric IDE source...

On Wed, Sep 17, 2008 at 3:30 PM, inhahe <inhahe at gmail.com> wrote:
> I would like to capture any error that happen in an app using PyQt
> I tried this:
>
> while 1:
>  try:
>    app.processEvents()
>  except:
>    do stuff here with sys.exc_info()
>
> but it doesn't quite work, i guess because of PyQt handling events in
> other threads.   so my question is.. how do I capture all exceptions?
> thx.
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>


More information about the PyQt mailing list