* python/python-value.c (valpy_richcompare): Don't return from

inside a TRY_CATCH.
This commit is contained in:
Tom Tromey
2009-08-24 18:55:21 +00:00
parent 765abe2bec
commit f02779d8c5
2 changed files with 15 additions and 2 deletions

View File

@ -693,7 +693,10 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
{
value_other = convert_value_from_python (other);
if (value_other == NULL)
return NULL;
{
result = -1;
break;
}
switch (op) {
case Py_LT:
@ -720,11 +723,16 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
/* Can't happen. */
PyErr_SetString (PyExc_NotImplementedError,
"Invalid operation on gdb.Value.");
return NULL;
result = -1;
break;
}
}
GDB_PY_HANDLE_EXCEPTION (except);
/* In this case, the Python exception has already been set. */
if (result < 0)
return NULL;
if (result == 1)
Py_RETURN_TRUE;