[PyKDE] problem with exceptions within events

Ulrich Berning ulrich.berning at desys.de
Fri Feb 25 14:33:49 GMT 2005


Phil Thompson schrieb:

>>Why not inspect the calling frames? A method called asynchronous by
>>QApplication.exec_loop() must have exec_loop() in one of it's outer
>>frames, a method called synchronous outside the exec_loop doesn't have
>>exec_loop() in its outer frames. It's just an idea, don't know if it
>>could work.
>>    
>>
>
>My first reaction is that it is very PyQt specific - you'd want to have an
>annotation that allowed to you to mark a method as needing that sort of
>treatment. I haven't done much with inspecting Python byte code, but the
>phrase "can of worms" springs to mind.
>
>  
>
What do you mean with 'very PyQt specific'?
Do you mean the fact, that SIP has to do the error checking after a 
method call, not knowing if it has called a method from a PyQt class or 
from any other class that is wrapped with SIP?
PyQt or any other extension wrapped with SIP could install an optional 
exception handler hook, that is called by SIP, indicating how to handle 
the exception (propagate to caller or use PyErr_Print()).

Ulli




More information about the PyQt mailing list