]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Python limited API: migrate PyImport_ExtendInittab
authorMatthieu Longo <matthieu.longo@arm.com>
Tue, 6 Jan 2026 13:13:27 +0000 (13:13 +0000)
committerMatthieu Longo <matthieu.longo@arm.com>
Wed, 28 Jan 2026 09:41:32 +0000 (09:41 +0000)
This patch replaces PyImport_ExtendInittab () with its limited C
API equivalent, PyImport_AppendInittab (), a convenience wrapper
around PyImport_ExtendInittab ().

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

index 989add70d1a7531e92c966efd64034afce5014ea..79b5d24d1cfbcbe521fdf9829530353ace019712 100644 (file)
@@ -2590,14 +2590,8 @@ do_start_initialization ()
 {
   /* Define all internal modules.  These are all imported (and thus
      created) during initialization.  */
-  struct _inittab mods[] =
-  {
-    { "_gdb", init__gdb_module },
-    { "_gdbevents", gdbpy_events_mod_func },
-    { nullptr, nullptr }
-  };
-
-  if (PyImport_ExtendInittab (mods) < 0)
+  if (PyImport_AppendInittab ("_gdb", init__gdb_module) < 0
+      || PyImport_AppendInittab ("_gdbevents", gdbpy_events_mod_func) < 0)
     return false;
 
   if (!py_initialize ())