Hi everyone,
twice now I've stumbled over a subtle bug when subclassing QObject. When
the getter of a python property raises an AttributeError for any
attribute or object, PyQt seems to reraise this error improperly,
clearing the traceback and often reporting a false object type and
attribute name. See the attached script for a minimal example.

Regards,
Ben
from PyQt4 import QtCore

class Object(QtCore.QObject):

    def getX(self):
        # Raises AttributeError: 'module' object has no attribute 'iDontExist'
        return QtCore.iDontExist

    x = property(fget=getX)


if __name__ == "__main__":
    o = Object()
    # Raises AttributeError: 'Object' object has no attribute 'x'
    o.x
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to