summaryrefslogtreecommitdiffstats
path: root/Modules/operator.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/operator.c')
-rw-r--r--Modules/operator.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/Modules/operator.c b/Modules/operator.c
index bf3def4..fa40da4 100644
--- a/Modules/operator.c
+++ b/Modules/operator.c
@@ -137,15 +137,7 @@ op_ipow(PyObject *s, PyObject *a)
static PyObject *
op_index(PyObject *s, PyObject *a)
{
- Py_ssize_t i;
- PyObject *a1;
- if (!PyArg_UnpackTuple(a,"index", 1, 1, &a1))
- return NULL;
- i = PyNumber_Index(a1);
- if (i == -1 && PyErr_Occurred())
- return NULL;
- else
- return PyInt_FromSsize_t(i);
+ return PyNumber_Index(a);
}
static PyObject*
@@ -247,7 +239,7 @@ spam1o(isMappingType,
spam1(is_, "is_(a, b) -- Same as a is b.")
spam1(is_not, "is_not(a, b) -- Same as a is not b.")
-spam2(index, __index__, "index(a) -- Same as a.__index__()")
+spam2o(index, __index__, "index(a) -- Same as a.__index__()")
spam2(add,__add__, "add(a, b) -- Same as a + b.")
spam2(sub,__sub__, "sub(a, b) -- Same as a - b.")
spam2(mul,__mul__, "mul(a, b) -- Same as a * b.")