]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: switch sequence protocol helpers to Python limited API equivalents
authorMatthieu Longo <matthieu.longo@arm.com>
Wed, 28 Jan 2026 15:41:00 +0000 (15:41 +0000)
committerMatthieu Longo <matthieu.longo@arm.com>
Fri, 27 Feb 2026 11:38:57 +0000 (11:38 +0000)
* PySequence_ITEM -> PySequence_GetItem

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
Approved-By: Tom Tromey <tom@tromey.com>
gdb/python/py-inferior.c
gdb/python/py-mi.c

index fd9da27b92e4f959f81a7ffeed13480684381b2d..ab948d28ebec129e7e8f4e0b7157ee43b79207f6 100644 (file)
@@ -896,7 +896,7 @@ infpy_set_args (PyObject *self, PyObject *value, void *closure)
        return -1;
       for (Py_ssize_t i = 0; i < len; ++i)
        {
-         gdbpy_ref<> item (PySequence_ITEM (value, i));
+         gdbpy_ref<> item (PySequence_GetItem (value, i));
          if (item == nullptr)
            return -1;
          gdb::unique_xmalloc_ptr<char> str
index 6c1a883724852a020570e873d9d28cc9a6416f67..5189bda944ecddd45bd4924553ceb7bdc49ce730 100644 (file)
@@ -278,7 +278,7 @@ serialize_mi_result_1 (PyObject *result, const char *field_name)
        gdbpy_handle_exception ();
       for (Py_ssize_t i = 0; i < len; ++i)
        {
-         gdbpy_ref<> item (PySequence_ITEM (result, i));
+         gdbpy_ref<> item (PySequence_GetItem (result, i));
          if (item == nullptr)
            gdbpy_handle_exception ();
          serialize_mi_result_1 (item.get (), nullptr);