diff options
| author | Guido van Rossum <guido@python.org> | 1997-05-23 00:06:51 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1997-05-23 00:06:51 +0000 |
| commit | e687d45910e368d1c6593beab27127fcba4d7f92 (patch) | |
| tree | 5c0c50eac47071c55e790cb1f3a2e8c5e703cb98 /Modules/arraymodule.c | |
| parent | 03ff1a5e2087c0142f58c10e6d1607e6cbb60228 (diff) | |
| download | cpython-e687d45910e368d1c6593beab27127fcba4d7f92.tar.gz | |
PyObject_Compare can raise an exception now.
Diffstat (limited to 'Modules/arraymodule.c')
| -rw-r--r-- | Modules/arraymodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 190600efa7..97af9ac5b6 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; |
