diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-05-20 01:47:23 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-05-20 01:47:23 (GMT) |
commit | a369923cab024889e638db781b7495533d1a1e77 (patch) | |
tree | 712728a970cc18bbc00ec76e3e404ae23c2a258a /Modules/_elementtree.c | |
parent | e26fa1bdcbbffd5986630144a2e15795c5f83a19 (diff) | |
download | cpython-a369923cab024889e638db781b7495533d1a1e77.zip cpython-a369923cab024889e638db781b7495533d1a1e77.tar.gz cpython-a369923cab024889e638db781b7495533d1a1e77.tar.bz2 |
Get rid of ugly code duplication for ElementTree.parse when the accelerator
is imported. Instead, ElementTree.parse can look for a special internal method
defined by the accelerator.
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r-- | Modules/_elementtree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 40cc096..c53f5ee 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3347,10 +3347,9 @@ xmlparser_feed(XMLParserObject* self, PyObject* args) } static PyObject* -xmlparser_parse(XMLParserObject* self, PyObject* args) +xmlparser_parse_whole(XMLParserObject* self, PyObject* args) { - /* (internal) parse until end of input stream */ - + /* (internal) parse the whole input, until end of stream */ PyObject* reader; PyObject* buffer; PyObject* temp; @@ -3526,7 +3525,7 @@ xmlparser_setevents(XMLParserObject *self, PyObject* args) static PyMethodDef xmlparser_methods[] = { {"feed", (PyCFunction) xmlparser_feed, METH_VARARGS}, {"close", (PyCFunction) xmlparser_close, METH_VARARGS}, - {"_parse", (PyCFunction) xmlparser_parse, METH_VARARGS}, + {"_parse_whole", (PyCFunction) xmlparser_parse_whole, METH_VARARGS}, {"_setevents", (PyCFunction) xmlparser_setevents, METH_VARARGS}, {"doctype", (PyCFunction) xmlparser_doctype, METH_VARARGS}, {NULL, NULL} |