diff options
author | Oren Milman <orenmn@gmail.com> | 2017-09-12 14:39:15 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-09-12 14:39:15 (GMT) |
commit | d056818ed2ade6d28190a375d7183f4aef9caa55 (patch) | |
tree | 7d0eb2824693f01ec9c21e1db5d09730eaaeb375 /Modules/clinic | |
parent | 98758bc67fb39b74bab368bef8ff3b34554c77c8 (diff) | |
download | cpython-d056818ed2ade6d28190a375d7183f4aef9caa55.zip cpython-d056818ed2ade6d28190a375d7183f4aef9caa55.tar.gz cpython-d056818ed2ade6d28190a375d7183f4aef9caa55.tar.bz2 |
bpo-31428: Prevent raising a SystemError in case the memo arg of ElementTree.Element.__deepcopy__() isn't a dictionary. (#3512)
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_elementtree.c.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 19a7797..9563afa 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -70,6 +70,24 @@ PyDoc_STRVAR(_elementtree_Element___deepcopy____doc__, #define _ELEMENTTREE_ELEMENT___DEEPCOPY___METHODDEF \ {"__deepcopy__", (PyCFunction)_elementtree_Element___deepcopy__, METH_O, _elementtree_Element___deepcopy____doc__}, +static PyObject * +_elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo); + +static PyObject * +_elementtree_Element___deepcopy__(ElementObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *memo; + + if (!PyArg_Parse(arg, "O!:__deepcopy__", &PyDict_Type, &memo)) { + goto exit; + } + return_value = _elementtree_Element___deepcopy___impl(self, memo); + +exit: + return return_value; +} + PyDoc_STRVAR(_elementtree_Element___sizeof____doc__, "__sizeof__($self, /)\n" "--\n" @@ -731,4 +749,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject **args, Py_ssi exit: return return_value; } -/*[clinic end generated code: output=75d0ff80e20b830f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ed55bd5209c12364 input=a9049054013a1b77]*/ |