mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-131938: Update exception message for Element.remove()
when an element is not found (#131972)
The exception message for `xml.etree.ElementTree.Element.remove` when an element is not found has been updated from "list.remove(x): x not in list" to "Element.remove(x): element not found".
This commit is contained in:
parent
df59226997
commit
04bc681e7c
4 changed files with 12 additions and 4 deletions
|
@ -1654,7 +1654,8 @@ _elementtree_Element_remove_impl(ElementObject *self, PyObject *subelement)
|
|||
}
|
||||
|
||||
if (rc == 0) {
|
||||
PyErr_SetString(PyExc_ValueError, "list.remove(x): x not in list");
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"Element.remove(x): element not found");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue