Prevent core dump when attempt to delete __wrapped__ on C implementation. Raise TypeError instead.

This commit is contained in:
Graham Dumpleton
2013-09-21 21:15:30 +10:00
parent db897007db
commit b47de0ba7f

View File

@@ -1117,6 +1117,11 @@ static int WraptObjectProxy_set_wrapped(WraptObjectProxyObject *self,
return -1;
}
if (!value) {
PyErr_SetString(PyExc_TypeError, "__wrapped__ must be an object");
return -1;
}
Py_INCREF(value);
Py_DECREF(self->wrapped);