aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/python.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 291a3ae..0130d06 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-16 Kevin Buettner <kevinb@redhat.com>
+
+ * python/python.c (do_start_initialization): Don't call
+ PyEval_InitThreads for Python 3.9 and beyond.
+
2020-04-15 Kamil Rytarowski <n54@gmx.com>
* obsd-nat.c (obsd_nat_target::update_thread_list): Pass "this" to
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 02543ae..e56520a 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1701,7 +1701,12 @@ do_start_initialization ()
#endif
Py_Initialize ();
+#if PY_VERSION_HEX < 0x03090000
+ /* PyEval_InitThreads became deprecated in Python 3.9 and will
+ be removed in Python 3.11. Prior to Python 3.7, this call was
+ required to initialize the GIL. */
PyEval_InitThreads ();
+#endif
#ifdef IS_PY3K
gdb_module = PyImport_ImportModule ("_gdb");