OSDN Git Service

PR python/11391:
authortromey <tromey>
Mon, 23 Aug 2010 20:27:48 +0000 (20:27 +0000)
committertromey <tromey>
Mon, 23 Aug 2010 20:27:48 +0000 (20:27 +0000)
* python/py-value.c (valpy_nonzero): Don't throw error for other
Value types.

gdb/ChangeLog
gdb/python/py-value.c

index 096810d..3e614f9 100644 (file)
@@ -1,5 +1,11 @@
 2010-08-23  Tom Tromey  <tromey@redhat.com>
 
+       PR python/11391:
+       * python/py-value.c (valpy_nonzero): Don't throw error for other
+       Value types.
+
+2010-08-23  Tom Tromey  <tromey@redhat.com>
+
        PR python/10676:
        * python/py-type.c: Include bcache.h, vec.h.
        (struct type_equality_entry): New.
index d547ed1..75ee0de 100644 (file)
@@ -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.  */