diff options
author | Tom Tromey <tromey@redhat.com> | 2009-08-24 18:55:21 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-08-24 18:55:21 +0000 |
commit | f02779d8c5d4f0904fc58d7d144386200f702976 (patch) | |
tree | cd9f5ac7be7dd99588873d14d8a44b3a6323f8cc /gdb/python | |
parent | 765abe2bec27ba6c69d53f3aee078749fc6df3c0 (diff) | |
download | gdb-f02779d8c5d4f0904fc58d7d144386200f702976.zip gdb-f02779d8c5d4f0904fc58d7d144386200f702976.tar.gz gdb-f02779d8c5d4f0904fc58d7d144386200f702976.tar.bz2 |
* python/python-value.c (valpy_richcompare): Don't return from
inside a TRY_CATCH.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/python-value.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c index c4217d5..3d88aa3 100644 --- a/gdb/python/python-value.c +++ b/gdb/python/python-value.c @@ -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; |