about the best we can do is call PyErr_WriteUnraisable and go on.
We won't be able to do the call below either, so verify delstr is valid.
if (delstr == NULL) {
delstr = PyString_InternFromString("__del__");
if (delstr == NULL)
- return NULL;
+ PyErr_WriteUnraisable((PyObject*)inst);
}
- if ((del = instance_getattr2(inst, delstr)) != NULL) {
+ if (delstr && (del = instance_getattr2(inst, delstr)) != NULL) {
PyObject *res = PyEval_CallObject(del, (PyObject *)NULL);
if (res == NULL)
PyErr_WriteUnraisable(del);