diff Modules/_elementtree.c @ 83852:8425e8cc2bf2

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.
author Eli Bendersky <eliben@gmail.com>
date Sun, 19 May 2013 18:47:23 -0700
parents 19767536ce84
children 659c1ce8ed2f
line wrap: on
line diff
--- a/Modules/_elementtree.c	Sun May 19 17:49:54 2013 -0700
+++ b/Modules/_elementtree.c	Sun May 19 18:47:23 2013 -0700
@@ -3347,10 +3347,9 @@
 }
 
 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 @@
 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}