aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-symbol.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-06-07 09:15:24 -0600
committerTom Tromey <tromey@adacore.com>2022-06-23 09:27:30 -0600
commitc86acd3f180419c3d9825170492363fe2322fa8d (patch)
tree8cbf3d2944695d4300e83c591f28557ef3e51524 /gdb/python/py-symbol.c
parent570e911f4e533fad33ad5e4e1102929cf7e80bd7 (diff)
downloadgdb-c86acd3f180419c3d9825170492363fe2322fa8d.zip
gdb-c86acd3f180419c3d9825170492363fe2322fa8d.tar.gz
gdb-c86acd3f180419c3d9825170492363fe2322fa8d.tar.bz2
Use PyBool_FromLong
I noticed a few spots that were explicitly creating new references to Py_True or Py_False. It's simpler here to use PyBool_FromLong, so this patch changes all the places I found.
Diffstat (limited to 'gdb/python/py-symbol.c')
-rw-r--r--gdb/python/py-symbol.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 02c35ac..23495b6 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -426,8 +426,7 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
}
PyTuple_SET_ITEM (ret_tuple.get (), 0, sym_obj);
- bool_obj = (is_a_field_of_this.type != NULL) ? Py_True : Py_False;
- Py_INCREF (bool_obj);
+ bool_obj = PyBool_FromLong (is_a_field_of_this.type != NULL);
PyTuple_SET_ITEM (ret_tuple.get (), 1, bool_obj);
return ret_tuple.release ();