diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-30 15:12:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-30 15:12:06 (GMT) |
commit | 762ec97ea68a1126b8855996c61fa8239dc9fff7 (patch) | |
tree | 8addf50d8a5ed50492790532396b08d1d25737bd /Modules/clinic | |
parent | 722a3af092b94983aa26f5e591fb1b45e2c2a0ff (diff) | |
download | cpython-762ec97ea68a1126b8855996c61fa8239dc9fff7.zip cpython-762ec97ea68a1126b8855996c61fa8239dc9fff7.tar.gz cpython-762ec97ea68a1126b8855996c61fa8239dc9fff7.tar.bz2 |
bpo-29204: Emit warnings for already deprecated ElementTree features. (#773)
Element.getiterator() and the html parameter of XMLParser() were
deprecated only in the documentation (since Python 3.2 and 3.4 correspondintly).
Now using them emits a deprecation warning.
* Don’t need check_warnings any more.
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_elementtree.c.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index c13cb35..7d1fd18 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -333,6 +333,35 @@ exit: return return_value; } +PyDoc_STRVAR(_elementtree_Element_getiterator__doc__, +"getiterator($self, /, tag=None)\n" +"--\n" +"\n"); + +#define _ELEMENTTREE_ELEMENT_GETITERATOR_METHODDEF \ + {"getiterator", (PyCFunction)_elementtree_Element_getiterator, METH_FASTCALL, _elementtree_Element_getiterator__doc__}, + +static PyObject * +_elementtree_Element_getiterator_impl(ElementObject *self, PyObject *tag); + +static PyObject * +_elementtree_Element_getiterator(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"tag", NULL}; + static _PyArg_Parser _parser = {"|O:getiterator", _keywords, 0}; + PyObject *tag = Py_None; + + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, + &tag)) { + goto exit; + } + return_value = _elementtree_Element_getiterator_impl(self, tag); + +exit: + return return_value; +} + PyDoc_STRVAR(_elementtree_Element_itertext__doc__, "itertext($self, /)\n" "--\n" @@ -726,4 +755,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject **args, Py_ssi exit: return return_value; } -/*[clinic end generated code: output=b69fa98c40917f58 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fbc92d64735adec0 input=a9049054013a1b77]*/ |