Index: Modules/pyexpat.c =================================================================== --- Modules/pyexpat.c (revision 75281) +++ Modules/pyexpat.c (working copy) @@ -980,7 +980,7 @@ void *buf = XML_GetBuffer(self->itself, BUF_SIZE); if (buf == NULL) { Py_XDECREF(readmethod); - return PyErr_NoMemory(); + return get_parse_result(self, 0); } if (fp) {