From: Tom Tromey Date: Mon, 23 Aug 2010 20:27:49 +0000 (+0000) Subject: PR python/11391: X-Git-Tag: sid-snapshot-20100901~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96f73ba54fb8e863d7c5d2b7cf3678ea6693952a;p=thirdparty%2Fbinutils-gdb.git PR python/11391: * python/py-value.c (valpy_nonzero): Don't throw error for other Value types. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 096810d8678..3e614f9c8e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-08-23 Tom Tromey + + PR python/11391: + * python/py-value.c (valpy_nonzero): Don't throw error for other + Value types. + 2010-08-23 Tom Tromey PR python/10676: diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index d547ed1b172..75ee0de4db3 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -712,11 +712,8 @@ valpy_nonzero (PyObject *self) TYPE_LENGTH (type), gdbarch_byte_order (get_type_arch (type))); else - { - PyErr_SetString (PyExc_TypeError, _("Attempted truth testing on invalid " - "gdb.Value type.")); - return 0; - } + /* All other values are True. */ + return 1; } /* Implements ~ for value objects. */