diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-06-29 20:08:52 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-06-29 20:08:52 (GMT) |
commit | 4a01cab89894b157f282b2032862a278c9edb842 (patch) | |
tree | cf4d7a979b071d6c99ac909a4d47dd9b60a15aea /Modules/clinic | |
parent | bc9e75ed023ff03f555682e57d25fee32e6548a0 (diff) | |
parent | 05744ac6e0948cbd6a50fc03a239a5402abceb14 (diff) | |
download | cpython-4a01cab89894b157f282b2032862a278c9edb842.zip cpython-4a01cab89894b157f282b2032862a278c9edb842.tar.gz cpython-4a01cab89894b157f282b2032862a278c9edb842.tar.bz2 |
Issue #19176: Fixed doctype() related bugs in C implementation of ElementTree.
A deprecation warning no longer issued by XMLParser subclass with default
doctype() method. Direct call of doctype() now issues a warning. Parser's
doctype() now is not called if target's doctype() is called. Based on patch
by Martin Panter.
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_elementtree.c.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index a4c3f91..86b4c4c 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -619,20 +619,33 @@ PyDoc_STRVAR(_elementtree_XMLParser__parse_whole__doc__, {"_parse_whole", (PyCFunction)_elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__}, PyDoc_STRVAR(_elementtree_XMLParser_doctype__doc__, -"doctype($self, /)\n" +"doctype($self, name, pubid, system, /)\n" "--\n" "\n"); #define _ELEMENTTREE_XMLPARSER_DOCTYPE_METHODDEF \ - {"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_NOARGS, _elementtree_XMLParser_doctype__doc__}, + {"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_VARARGS, _elementtree_XMLParser_doctype__doc__}, static PyObject * -_elementtree_XMLParser_doctype_impl(XMLParserObject *self); +_elementtree_XMLParser_doctype_impl(XMLParserObject *self, PyObject *name, + PyObject *pubid, PyObject *system); static PyObject * -_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject *Py_UNUSED(ignored)) +_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject *args) { - return _elementtree_XMLParser_doctype_impl(self); + PyObject *return_value = NULL; + PyObject *name; + PyObject *pubid; + PyObject *system; + + if (!PyArg_UnpackTuple(args, "doctype", + 3, 3, + &name, &pubid, &system)) + goto exit; + return_value = _elementtree_XMLParser_doctype_impl(self, name, pubid, system); + +exit: + return return_value; } PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__, @@ -663,4 +676,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *args) exit: return return_value; } -/*[clinic end generated code: output=119aed84c1545187 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=25b8bf7e7f2151ca input=a9049054013a1b77]*/ |