summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2003-06-17 19:27:39 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2003-06-17 19:27:39 (GMT)
commite8049befdfa75501762f7b8afdf06335a2f6acba (patch)
tree4fe9873b63f2f55e6e5a18ea11341509fd8bc533 /Objects
parent8e9b80fd561e68574ee313f32d3fd6cde59d7723 (diff)
downloadcpython-e8049befdfa75501762f7b8afdf06335a2f6acba.zip
cpython-e8049befdfa75501762f7b8afdf06335a2f6acba.tar.gz
cpython-e8049befdfa75501762f7b8afdf06335a2f6acba.tar.bz2
Use _PyEval_SliceIndex to handle list.index() calls with
huge start and stop arguments. Add tests.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/listobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index a70ac5f..b059420 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -1832,7 +1832,9 @@ listindex(PyListObject *self, PyObject *args)
int i, start=0, stop=self->ob_size;
PyObject *v;
- if (!PyArg_ParseTuple(args, "O|ii:index", &v, &start, &stop))
+ if (!PyArg_ParseTuple(args, "O|O&O&:index", &v,
+ _PyEval_SliceIndex, &start,
+ _PyEval_SliceIndex, &stop))
return NULL;
if (start < 0) {
start += self->ob_size;