aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 551438c..08749d1 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -177,6 +177,10 @@ gdb_PySys_GetObject (const char *name)
#define PySys_GetObject gdb_PySys_GetObject
+/* PySys_SetPath was deprecated in Python 3.11. Disable the deprecated
+ code for Python 3.10 and newer. */
+#if PY_VERSION_HEX < 0x030a0000
+
/* PySys_SetPath's 'path' parameter was missing the 'const' qualifier
before Python 3.6. Hence, we wrap it in a function to avoid errors
when compiled with -Werror. */
@@ -190,6 +194,7 @@ gdb_PySys_SetPath (const GDB_PYSYS_SETPATH_CHAR *path)
}
#define PySys_SetPath gdb_PySys_SetPath
+#endif
/* Wrap PyGetSetDef to allow convenient construction with string
literals. Unfortunately, PyGetSetDef's 'name' and 'doc' members