summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2023-07-05 22:19:49 (GMT)
committerGitHub <noreply@github.com>2023-07-05 22:19:49 (GMT)
commit217f47d6e5e56bca78b8556e910cd00890f6f84a (patch)
treec600ffab79053ad4e95c846d94e915d7903ad774 /Objects/listobject.c
parentc16ea94abc73c0098b484f7e2ec23bfd9c36b67c (diff)
downloadcpython-217f47d6e5e56bca78b8556e910cd00890f6f84a.zip
cpython-217f47d6e5e56bca78b8556e910cd00890f6f84a.tar.gz
cpython-217f47d6e5e56bca78b8556e910cd00890f6f84a.tar.bz2
gh-96844: Improve error message of list.remove (gh-106455)
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 98fa089..144ede6 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -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;
}