[PyQt] SIP: newbie question 3

Jens Thoms Toerring jt at toerring.de
Fri Jul 8 10:06:52 BST 2011


On Fri, Jul 08, 2011 at 10:13:04AM +0200, Sébastien Petitdemange wrote:
> On 07/08/2011 09:58 AM, Johan Råde wrote:
> > I tried adding the following directive to my sip file, but it seems to
> > have no effect. There is still a crash when an exception is thrown in
> > the C++ code.
>
> Try this:
> 
> %Exception std::exception(SIP_Exception) /Default/
> {
> %TypeHeaderCode
> #    include "../../Common.h"
> #    include "../../TextTable/Exceptions.h"
> %End
> %RaiseCode
>      SIP_BLOCK_THREADS
>      translate(sipExceptionRef)
>      SIP_UNBLOCK_THREADS
> %End
> };

Another point that may interfere: do you run SIP with the '-e'
option?

 -e

    Support for C++ exceptions is enabled. This causes all calls
    to C++ code to be enclosed in try/catch blocks and C++ excep-
    tions to be converted to Python exceptions. By default excep=
    tion support is disabled.

                             Best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      jt at toerring.de
   \_______________________________      http://toerring.de


More information about the PyQt mailing list