diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_elementtree.c | 60 | ||||
-rw-r--r-- | Modules/clinic/_elementtree.c.h | 55 |
2 files changed, 1 insertions, 114 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 830ce86..b88e8a1 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -1426,42 +1426,6 @@ _elementtree_Element_get_impl(ElementObject *self, PyObject *key, return value; } -/*[clinic input] -_elementtree.Element.getchildren - -[clinic start generated code]*/ - -static PyObject * -_elementtree_Element_getchildren_impl(ElementObject *self) -/*[clinic end generated code: output=e50ffe118637b14f input=0f754dfded150d5f]*/ -{ - Py_ssize_t i; - PyObject* list; - - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "This method will be removed in future versions. " - "Use 'list(elem)' or iteration over elem instead.", - 1) < 0) { - return NULL; - } - - if (!self->extra) - return PyList_New(0); - - list = PyList_New(self->extra->length); - if (!list) - return NULL; - - for (i = 0; i < self->extra->length; i++) { - PyObject* item = self->extra->children[i]; - Py_INCREF(item); - PyList_SET_ITEM(list, i, item); - } - - return list; -} - - static PyObject * create_elementiter(ElementObject *self, PyObject *tag, int gettext); @@ -1493,27 +1457,6 @@ _elementtree_Element_iter_impl(ElementObject *self, PyObject *tag) /*[clinic input] -_elementtree.Element.getiterator - - tag: object = None - -[clinic start generated code]*/ - -static PyObject * -_elementtree_Element_getiterator_impl(ElementObject *self, PyObject *tag) -/*[clinic end generated code: output=cb69ff4a3742dfa1 input=500da1a03f7b9e28]*/ -{ - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "This method will be removed in future versions. " - "Use 'tree.iter()' or 'list(tree.iter())' instead.", - 1) < 0) { - return NULL; - } - return _elementtree_Element_iter_impl(self, tag); -} - - -/*[clinic input] _elementtree.Element.itertext [clinic start generated code]*/ @@ -4220,9 +4163,6 @@ static PyMethodDef element_methods[] = { _ELEMENTTREE_ELEMENT_ITERTEXT_METHODDEF _ELEMENTTREE_ELEMENT_ITERFIND_METHODDEF - _ELEMENTTREE_ELEMENT_GETITERATOR_METHODDEF - _ELEMENTTREE_ELEMENT_GETCHILDREN_METHODDEF - _ELEMENTTREE_ELEMENT_ITEMS_METHODDEF _ELEMENTTREE_ELEMENT_KEYS_METHODDEF diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 324e549..a58ad73 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -355,23 +355,6 @@ exit: return return_value; } -PyDoc_STRVAR(_elementtree_Element_getchildren__doc__, -"getchildren($self, /)\n" -"--\n" -"\n"); - -#define _ELEMENTTREE_ELEMENT_GETCHILDREN_METHODDEF \ - {"getchildren", (PyCFunction)_elementtree_Element_getchildren, METH_NOARGS, _elementtree_Element_getchildren__doc__}, - -static PyObject * -_elementtree_Element_getchildren_impl(ElementObject *self); - -static PyObject * -_elementtree_Element_getchildren(ElementObject *self, PyObject *Py_UNUSED(ignored)) -{ - return _elementtree_Element_getchildren_impl(self); -} - PyDoc_STRVAR(_elementtree_Element_iter__doc__, "iter($self, /, tag=None)\n" "--\n" @@ -408,42 +391,6 @@ exit: return return_value; } -PyDoc_STRVAR(_elementtree_Element_getiterator__doc__, -"getiterator($self, /, tag=None)\n" -"--\n" -"\n"); - -#define _ELEMENTTREE_ELEMENT_GETITERATOR_METHODDEF \ - {"getiterator", (PyCFunction)(void(*)(void))_elementtree_Element_getiterator, METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_getiterator__doc__}, - -static PyObject * -_elementtree_Element_getiterator_impl(ElementObject *self, PyObject *tag); - -static PyObject * -_elementtree_Element_getiterator(ElementObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) -{ - PyObject *return_value = NULL; - static const char * const _keywords[] = {"tag", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "getiterator", 0}; - PyObject *argsbuf[1]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; - PyObject *tag = Py_None; - - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - tag = args[0]; -skip_optional_pos: - return_value = _elementtree_Element_getiterator_impl(self, tag); - -exit: - return return_value; -} - PyDoc_STRVAR(_elementtree_Element_itertext__doc__, "itertext($self, /)\n" "--\n" @@ -969,4 +916,4 @@ skip_optional: exit: return return_value; } -/*[clinic end generated code: output=50e0b1954c5f9e0f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f5dbf9b4a095d310 input=a9049054013a1b77]*/ |