Commits

Anonymous committed ce51503

Backport rev 51262 from trunk -- squashes a compiler warning on Windows
about truly wrong code.

Checkin comment from 51262:

Can't return NULL from a void function. If there is a memory error,
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.

  • Participants
  • Parent commits 52b65f2
  • Branches 2.4

Comments (0)

Files changed (1)

File Objects/classobject.c

 	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);