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 d4edfc9abf)
This commit is contained in:
Serhiy Storchaka 2017-03-30 19:46:59 +03:00 committed by GitHub
parent a6b4e19022
commit bf4bb2e430
6 changed files with 31 additions and 11 deletions

View file

@ -1051,8 +1051,8 @@ deque_index(dequeobject *deque, PyObject *args)
int cmp;
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(deque);