summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-03-27 23:39:58 (GMT)
committerNed Deily <nad@acm.org>2014-03-27 23:39:58 (GMT)
commite7d532fbc9c13e00b1e5c6c0db2dba31d1212de7 (patch)
tree2bd2f23bfd2bcc454c47ff4dfad438b2e9114af1 /Modules/pyexpat.c
parent2542b66bb04e5634410205f54523987dce9e5bf7 (diff)
downloadcpython-e7d532fbc9c13e00b1e5c6c0db2dba31d1212de7.zip
cpython-e7d532fbc9c13e00b1e5c6c0db2dba31d1212de7.tar.gz
cpython-e7d532fbc9c13e00b1e5c6c0db2dba31d1212de7.tar.bz2
Issue #6676: Ensure a meaningful exception is raised when attempting
to parse more than one XML document per pyexpat xmlparser instance. (Original patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with suggested wording by David Gutteridge)
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index a71ecc5..97f2b56 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -908,7 +908,7 @@ xmlparse_ParseFile(xmlparseobject *self, PyObject *f)
void *buf = XML_GetBuffer(self->itself, BUF_SIZE);
if (buf == NULL) {
Py_XDECREF(readmethod);
- return PyErr_NoMemory();
+ return get_parse_result(self, 0);
}
bytes_read = readinst(buf, BUF_SIZE, readmethod);