[PyQt] Possible bug in QReadLocker and Python 2.7
Daniele Esposti
expo at expobrain.net
Wed Oct 13 09:33:51 BST 2010
Thank you Phil, just my 2 cents
On 12 October 2010 22:45, Phil Thompson <phil at riverbankcomputing.com> wrote:
> On Tue, 12 Oct 2010 15:50:21 +0100, Daniele Esposti <expo at expobrain.net>
> wrote:
>> Running the attached test under Python 2.7 raises an attribute error:
>>
>> Traceback (most recent call last):
>> File "locker.py", line 11, in <module>
>> with QtCore.QReadLocker( lock ):
>> AttributeError: __exit__
>>
>> Tested with Python 2.7, PyQt4 4.7.7-1, sip 4.11.1 under Windows and
> Linux.
>> The same code works well using Python 2.6.6, PyQt4 4.7.7-1, sip 4.11.1
>> under Windows and Linux.
>> Under Windows I'm using the binary package; under Linux I'm using the
>> source code.
>>
>> Is this a bug in QReadLocker() bindings ?
>
> It's caused by a change in the way context managers are implemented in
> Python v2.7 (and v3.2).
>
> Fixed in tonight's SIP snapshot.
>
> Thanks,
> Phil
>
--
Daniele Esposti
More information about the PyQt
mailing list