[PyQt] sip: extend exception support

Mathias.Born at gmx.de Mathias.Born at gmx.de
Wed Sep 19 22:17:56 BST 2012


On 19.09.2012, 11:07:14 Phil Thompson wrote:
> On Mon, 17 Sep 2012 22:25:59 +0200, Mathias.Born at gmx.de wrote:
>> On 17.09.2012, 22:14:49 Phil Thompson wrote:
>>> On Mon, 27 Aug 2012 12:10:23 -0700, Matt Newell <newellm at blur.com>
> wrote:
>>>>> 
>>>>> The difference is the access to the (not necessarily present)
> objects.
>>>>> How
>>>>> are you getting these?
>>>>> 
>>>>> Phil
>>>> 
>>>> Here's the patch against a quite old hg checkout.
>> 
>>> After several more iterations (ok, rewrites) the implementation in the
>>> current snapshot should be Ok - and work with %Imported modules.
>> 
>>> Phil
>> 
>> I'm pleased to report that this works fine for me. Some comments:
>> 
>> In the docs about the "%DefaultVirtualErrorHandler" directive, there is
> a
>> typo
>> 
>> %DefaultVirtualErrorHandle my_handler
>> 
>> which should read
>> 
>> %DefaultVirtualErrorHandler my_handler
>> 
>> 
>> In addition, the function type is not
>> 
>> void my_handler(sip_gilstate_t, PyObject *);
>> 
>> but instead
>> 
>> void my_handler(sip_gilstate_t, sipSimpleWrapper*);

> You need to use the default branch (or a snapshot) - I changed it all
> again.

Ok, but that's not working properly anymore.

sip.h declares

typedef void (*sipVirtErrorHandlerFunc)(struct _sipSimpleWrapper *);

but the generated code containes error handlers that look like

void sipVEH_ltse_app_defaultVirtualErrorHandler(sip_gilstate_t, PyObject *)

And inside other functions they are referred to as, for example

extern void sipVEH_ltse_app_defaultVirtualErrorHandler(sip_gilstate_t, PyObject *);

Best Regards,
Mathias Born




More information about the PyQt mailing list