gh-96844: Improve error message of list.remove (gh-106455)

This commit is contained in:
Dong-hee Na 2023-07-06 07:19:49 +09:00 committed by GitHub
parent c16ea94abc
commit 217f47d6e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View file

@ -2694,7 +2694,7 @@ list_remove(PyListObject *self, PyObject *value)
else if (cmp < 0)
return NULL;
}
PyErr_SetString(PyExc_ValueError, "list.remove(x): x not in list");
PyErr_Format(PyExc_ValueError, "%R is not in list", value);
return NULL;
}