summaryrefslogtreecommitdiffstats
path: root/Modules/operator.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-03-06 18:59:11 (GMT)
committerGeorg Brandl <georg@python.org>2007-03-06 18:59:11 (GMT)
commit40c626159d8da4b241980deb1f356b62a101bd51 (patch)
tree5affa11622b32422d6d8215fd2ded62329ae7d9e /Modules/operator.c
parent667eb7c8536661f1b4648ed5c2d1155b585a3b01 (diff)
downloadcpython-40c626159d8da4b241980deb1f356b62a101bd51.zip
cpython-40c626159d8da4b241980deb1f356b62a101bd51.tar.gz
cpython-40c626159d8da4b241980deb1f356b62a101bd51.tar.bz2
Patch #1654417: make operator.{get,set,del}slice use the full range
of Py_ssize_t.
Diffstat (limited to 'Modules/operator.c')
-rw-r--r--Modules/operator.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/Modules/operator.c b/Modules/operator.c
index 7479a53..0a7222a 100644
--- a/Modules/operator.c
+++ b/Modules/operator.c
@@ -168,43 +168,41 @@ static PyObject*
op_getslice(PyObject *s, PyObject *a)
{
PyObject *a1;
- int a2,a3;
+ Py_ssize_t a2, a3;
- if (!PyArg_ParseTuple(a,"Oii:getslice",&a1,&a2,&a3))
+ if (!PyArg_ParseTuple(a, "Onn:getslice", &a1, &a2, &a3))
return NULL;
- return PySequence_GetSlice(a1,a2,a3);
+ return PySequence_GetSlice(a1, a2, a3);
}
static PyObject*
op_setslice(PyObject *s, PyObject *a)
{
PyObject *a1, *a4;
- int a2,a3;
+ Py_ssize_t a2, a3;
- if (!PyArg_ParseTuple(a,"OiiO:setslice",&a1,&a2,&a3,&a4))
+ if (!PyArg_ParseTuple(a, "OnnO:setslice", &a1, &a2, &a3, &a4))
return NULL;
- if (-1 == PySequence_SetSlice(a1,a2,a3,a4))
+ if (-1 == PySequence_SetSlice(a1, a2, a3, a4))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
op_delslice(PyObject *s, PyObject *a)
{
PyObject *a1;
- int a2,a3;
+ Py_ssize_t a2, a3;
- if(! PyArg_ParseTuple(a,"Oii:delslice",&a1,&a2,&a3))
+ if (!PyArg_ParseTuple(a, "Onn:delslice", &a1, &a2, &a3))
return NULL;
- if (-1 == PySequence_DelSlice(a1,a2,a3))
+ if (-1 == PySequence_DelSlice(a1, a2, a3))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#undef spam1