This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [python] [patch] PR 13624


Could you make the new exception be a more explicit Pythonic one?  TypeError seems like the natural fit.

	paul

-----Original Message-----
From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Phil Muldoon
Sent: Thursday, October 06, 2011 8:49 AM
To: gdb-patches@sourceware.org
Subject: [python] [patch] PR 13624


The patch address PR 13624 which noted that in some instances we were not catching GDB exceptions.  I checked every function and I found two GDB cases, and one Python case.

OK?

Cheers,

Phil

--

2011-10-06  Phil Muldoon  <pmuldoon@redhat.com>

	* python/py-value.c (valpy_call): Check that arguments are
	a tuple.
	(valpy_nonzero): Catch GDB exceptions.
	(valpy_absolute): Ditto.
--

diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 252d9b9..48bbb0a 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -519,6 +519,13 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
       return NULL;
     }
 
+  if (! PyTuple_Check (args))
+    {
+      PyErr_SetString (PyExc_RuntimeError,
+		       _("Inferior arguments must be provided in a tuple."));
+      return NULL;
+    }
+
...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]