diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-30 16:46:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-30 16:46:59 (GMT) |
commit | bf4bb2e43030661e568d5d4b046e8b9351cc164c (patch) | |
tree | b014ec3810488d4cb4995b9af1748302bd7b1ed2 /Objects | |
parent | a6b4e1902250d6f28ca6d083ce1c8d7e9b91974b (diff) | |
download | cpython-bf4bb2e43030661e568d5d4b046e8b9351cc164c.zip cpython-bf4bb2e43030661e568d5d4b046e8b9351cc164c.tar.gz cpython-bf4bb2e43030661e568d5d4b046e8b9351cc164c.tar.bz2 |
bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) (#907)
when pass indices of wrong type.
(cherry picked from commit d4edfc9abffca965e76ebc5957a92031a4d6c4d4)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/listobject.c | 4 | ||||
-rw-r--r-- | Objects/tupleobject.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index dcd7b5e..cde281a 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2153,8 +2153,8 @@ listindex(PyListObject *self, PyObject *args) PyObject *v; if (!PyArg_ParseTuple(args, "O|O&O&:index", &v, - _PyEval_SliceIndex, &start, - _PyEval_SliceIndex, &stop)) + _PyEval_SliceIndexNotNone, &start, + _PyEval_SliceIndexNotNone, &stop)) return NULL; if (start < 0) { start += Py_SIZE(self); diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index c0ff499..52f20f4 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -522,8 +522,8 @@ tupleindex(PyTupleObject *self, PyObject *args) PyObject *v; if (!PyArg_ParseTuple(args, "O|O&O&:index", &v, - _PyEval_SliceIndex, &start, - _PyEval_SliceIndex, &stop)) + _PyEval_SliceIndexNotNone, &start, + _PyEval_SliceIndexNotNone, &stop)) return NULL; if (start < 0) { start += Py_SIZE(self); |