On Thu, 10 Mar 2011 15:44:51 -0800, Peter Shinners
<[email protected]>
wrote:
> There is a surprising TypeError using getattr. This only happens when
the
> attribute being queried does not exist. This is happening on Windows and
> Osx with Python 2.5
> 
>>>> from PyQt4 import QtCore
>>>> obj = QtCore.QObject()
>>>> getattr(obj, "doesNotExist", False)
> exceptions.TypeError, 'sip.methoddescriptor' object is not callable
> 
> If accessing this attribute directly, the same TypeError is given,
instead
> of an expected AttributeError. Note that hasattr() is working as
expected.

It's a Python bug. See...

http://www.riverbankcomputing.com/pipermail/pyqt/2011-February/029217.html

Phil
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to