[PyKDE] segfault using hasattr on a wrappertype class

Phil Thompson phil at riverbankcomputing.co.uk
Thu Oct 13 18:00:48 BST 2005


On Thursday 13 October 2005 1:45 pm, Giovanni Bajo wrote:
> Hello,
>
> this snippet causes a segfault on my computer (using Python 2.4.2):
> >>> import sip
> >>> sip.SIP_VERSION_STR
>
> '4.3.1'
>
> >>> class Foo(object):
>
> ...     __metaclass__ = sip.wrappertype
> ...
>
> >>> hasattr(Foo, "bar")
>
> Segmentation fault

It will be fixed in tonight's snapshot.

It will now raise an exception saying that Foo should be derived from 
sip.wrapper. If you change it so it is, hasattr() returns False as expected.

Thanks,
Phil




More information about the PyQt mailing list