<br>On 5/25/07, Detlev Offenbach <<a href="mailto:detlev@die-offenbachs.de">detlev@die-offenbachs.de</a>> wrote:<br>> On Donnerstag, 24. Mai 2007, Arve Knudsen wrote:<br>> > Hi Detlev<br>> ><br>> > On 5/24/07, Detlev Offenbach <
<a href="mailto:detlev@die-offenbachs.de">detlev@die-offenbachs.de</a>> wrote:<br>> > > On Mittwoch, 23. Mai 2007, Arve Knudsen wrote:<br>> > > > Is it possible to register a hook with QApplication in order to be
<br>> > ><br>> > > notified<br>> > ><br>> > > > of an unhandled exception? Currently, all that happens when an<br>> > > > exception propagates to the event loop is that it gets printed in the
<br>> > > > console,<br>> > ><br>> > > which<br>> > ><br>> > > > is not very helpful. How do others cope with unhandled exceptions in<br>> > ><br>> > > PyQt
<br>> > ><br>> > > > applications?<br>> > > ><br>> > > > Best regards,<br>> > > > Arve Knudsen<br>> > ><br>> > > See eric4 as an example.<br>> >
<br>> > I'm not at all familiar with eric4. Could you please elaborate as to where<br>> > I can look in eric4's source code (I assume this is what you mean)? Also, I<br>> > take it eric4 does something more advanced than override
sys.excepthook?<br>> ><br>> > Thanks,<br>> > Arve<br>> ><br>> > Detlev<br>> ><br>> > > --<br>> > > Detlev Offenbach<br>> > > <a href="mailto:detlev@die-offenbachs.de">
detlev@die-offenbachs.de</a><br>> def main():<br>> """<br>> Main entry point into the application.<br>> """<br>> sys.excepthook = excepthook<br>> <br><br>Can you tell me what happens if you call a piece of Qt code from Python which in turns invokes a Python callback, and the latter raises an exception? In my experience
sys.excepthook is useless in this scenario, because when control returns from the last Python callback, the exception is not propagated (i.e., there is normal flow of control). <br><br>Arve<br>