mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-30 13:23:50 +08:00
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.
This commit is contained in:
@ -128,8 +128,7 @@ cmdpy_function (const char *args, int from_tty, cmd_list_element *command)
|
||||
error (_("Could not convert arguments to Python string."));
|
||||
}
|
||||
|
||||
gdbpy_ref<> ttyobj
|
||||
= gdbpy_ref<>::new_reference (from_tty ? Py_True : Py_False);
|
||||
gdbpy_ref<> ttyobj (PyBool_FromLong (from_tty));
|
||||
gdbpy_ref<> result (PyObject_CallMethodObjArgs ((PyObject *) obj, invoke_cst,
|
||||
argobj.get (), ttyobj.get (),
|
||||
NULL));
|
||||
|
Reference in New Issue
Block a user