summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-05-23 00:06:51 (GMT)
committerGuido van Rossum <guido@python.org>1997-05-23 00:06:51 (GMT)
commitc8b6df90045a3f419e6fab272d93ad4159e54ccc (patch)
tree20cb4b6f0ba2718577079198780d5fc3852e4a70 /Modules/arraymodule.c
parent5b2121b25fc6a50fe229fe25ef6be8a2f883d1f4 (diff)
downloadcpython-c8b6df90045a3f419e6fab272d93ad4159e54ccc.zip
cpython-c8b6df90045a3f419e6fab272d93ad4159e54ccc.tar.gz
cpython-c8b6df90045a3f419e6fab272d93ad4159e54ccc.tar.bz2
PyObject_Compare can raise an exception now.
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 190600e..97af9ac 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -484,10 +484,8 @@ array_compare(v, w)
cmp = -1;
Py_XDECREF(ai);
Py_XDECREF(bi);
- if (cmp != 0) {
- PyErr_Clear(); /* XXX Can't report errors here */
+ if (cmp != 0)
return cmp;
- }
}
return v->ob_size - w->ob_size;
}
@@ -823,6 +821,7 @@ array_index(self, args)
for (i = 0; i < self->ob_size; i++) {
if (PyObject_Compare(self->ob_item[i], args) == 0)
return PyInt_FromLong((long)i);
+ /* XXX PyErr_Occurred */
}
PyErr_SetString(PyExc_ValueError, "array.index(x): x not in array");
return NULL;
@@ -845,6 +844,7 @@ array_count(self, args)
for (i = 0; i < self->ob_size; i++) {
if (PyObject_Compare(self->ob_item[i], args) == 0)
count++;
+ /* XXX PyErr_Occurred */
}
return PyInt_FromLong((long)count);
}
@@ -870,7 +870,7 @@ array_remove(self, args)
Py_INCREF(Py_None);
return Py_None;
}
-
+ /* XXX PyErr_Occurred */
}
PyErr_SetString(PyExc_ValueError, "array.remove(x): x not in array");
return NULL;