[PyKDE] problem with exceptions within events

Phil Thompson phil at riverbankcomputing.co.uk
Fri Feb 25 11:39:23 GMT 2005


> Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
>
>> So, rather than try and deal with the two conflicting requirements
>> (being
>> able to catch as many exceptions as possible, and being able to detect
>> exceptions in exec_loop()) I plan to simply revert to the pre-SIP 4.2
>> behaviour - unless anybody has any other bright ideas.
>
>
> Is it possible to translate Python exceptions to C++ exceptions? This way,
> you can automatic roll out of any C++ method, even blocking ones. Then,
> instead of explictly checking for python exception after each c++ method
> call, you wrap C++ calls with try/catch, and you get the wrapped Python
> exceptions there.
>
> This probably requires Qt compilatoin with exception support
> (-exceptions).
> I would find totally acceptable to have the pre-SIP 4.2 behaviour in case
> Qt
> is compiled without exception support.

Having the behaviour change depending on how the user (or their distro
provider) had built Qt is not a good idea.

Phil




More information about the PyQt mailing list