mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-31428: Prevent raising a SystemError in case the memo arg of ElementTree.Element.__deepcopy__() isn't a dictionary. (#3512)
This commit is contained in:
parent
98758bc67f
commit
d056818ed2
2 changed files with 24 additions and 5 deletions
|
@ -733,14 +733,14 @@ LOCAL(PyObject *) deepcopy(PyObject *, PyObject *);
|
|||
/*[clinic input]
|
||||
_elementtree.Element.__deepcopy__
|
||||
|
||||
memo: object
|
||||
memo: object(subclass_of="&PyDict_Type")
|
||||
/
|
||||
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element___deepcopy__(ElementObject *self, PyObject *memo)
|
||||
/*[clinic end generated code: output=d1f19851d17bf239 input=df24c2b602430b77]*/
|
||||
_elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo)
|
||||
/*[clinic end generated code: output=eefc3df50465b642 input=a2d40348c0aade10]*/
|
||||
{
|
||||
Py_ssize_t i;
|
||||
ElementObject* element;
|
||||
|
@ -849,7 +849,8 @@ deepcopy(PyObject *object, PyObject *memo)
|
|||
/* Fall through to general case */
|
||||
}
|
||||
else if (Element_CheckExact(object)) {
|
||||
return _elementtree_Element___deepcopy__((ElementObject *)object, memo);
|
||||
return _elementtree_Element___deepcopy___impl(
|
||||
(ElementObject *)object, memo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue