PR python/11391:
authorTom Tromey <tromey@redhat.com>
Mon, 23 Aug 2010 20:27:49 +0000 (20:27 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 23 Aug 2010 20:27:49 +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 096810d867804ca27668a60a6794b73c141fd341..3e614f9c8e2cb50334b97948c96f77f0bdf929c0 100644 (file)
@@ -1,3 +1,9 @@
+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:
index d547ed1b172a387563a8fa62923ce517be548c85..75ee0de4db3f0c1869cea73c65465c2745493991 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.  */