Only raise exception if no wrapped object if actually need to access it, else have issues in __new__() of derived class.

This commit is contained in:
Graham Dumpleton
2013-09-12 20:26:21 +10:00
parent 00dbd72216
commit 6209a3a1de

View File

@@ -1013,11 +1013,6 @@ static PyObject *WraptObjectProxy_getattro(
{
PyObject *object = NULL;
if (!self->wrapped) {
PyErr_SetString(PyExc_ValueError, "wrapper has not been initialised");
return NULL;
}
object = PyObject_GenericGetAttr((PyObject *)self, name);
if (object)
@@ -1025,6 +1020,11 @@ static PyObject *WraptObjectProxy_getattro(
PyErr_Clear();
if (!self->wrapped) {
PyErr_SetString(PyExc_ValueError, "wrapper has not been initialised");
return NULL;
}
return PyObject_GetAttr(self->wrapped, name);
}