[PyKDE] problem with exceptions within events

Ulrich Berning ulrich.berning at desys.de
Fri Feb 25 15:33:39 GMT 2005


Phil Thompson schrieb:

>>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()).
>>    
>>
>
>It's PyErr_Print() that calls the hook, not the other way around. That
>hook would have to be installed *after* any application installed hook.
>Very messy.
>  
>
Sorry, I wasn't clear enough. I do not mean 'sys.excepthook' or any 
replacement. I mean a function implemented in PyQt called by SIP.

SIP calls a method
SIP checks if an exception has occured
SIP checks, if the wrapped extension has installed a hook function (The 
module that provides exec_loop would do this)
If not, SIP calls PyErr_Print() ==> End
Otherwise SIP calls the hook funtion
SIP either propagates the exception or calls PyErr_Print() depending on 
the return value of the hook function ==> End

The hook function has to check, if one of the calling frames of the 
traceback frame contains the method exec_loop.
Maybe I'm totally wrong with my idea.

Ulli






More information about the PyQt mailing list