public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Bump minimum Python version to 3.4
@ 2023-06-02 16:33 Tom Tromey
  2023-06-02 18:01 ` Simon Marchi
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tom Tromey @ 2023-06-02 16:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: legouguec, Tom Tromey

While looking into the f-string issue, I noticed that the README
documents 3.2 as the minimum Python version, while gdb.texinfo says
3.0.2.  Asking on irc, I found out that SuSE's "LTS" ships 3.4, and
RHEL 7 ships 3.6.  Based on this I think it's reasonable to bump the
minimum required version to 3.4.
---
 gdb/NEWS                     |  2 ++
 gdb/README                   |  2 +-
 gdb/doc/gdb.texinfo          |  2 +-
 gdb/python/py-gdb-readline.c |  4 ----
 gdb/python/python-internal.h | 11 -----------
 5 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index 649a3a9824a..4a8f51c06c3 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,8 @@
 
 *** Changes since GDB 13
 
+* The minimum supported version of Python is now 3.4.
+
 * The AArch64 'org.gnu.gdb.aarch64.pauth' Pointer Authentication feature string
   has been deprecated in favor of the 'org.gnu.gdb.aarch64.pauth_v2' feature
   string.
diff --git a/gdb/README b/gdb/README
index 9699f4890c6..527aa5ff27c 100644
--- a/gdb/README
+++ b/gdb/README
@@ -516,7 +516,7 @@ more obscure GDB `configure' options are not listed here.
      GDB scripting much more powerful than the restricted CLI
      scripting language.  If your host does not have Python installed,
      you can find it on `http://www.python.org/download/'.  The oldest
-     version of Python supported by GDB is 3.2.  The optional argument
+     version of Python supported by GDB is 3.4.  The optional argument
      PYTHON is used to find the Python headers and libraries.  It can
      be either the name of a Python executable, or the name of the
      directory in which Python is installed.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index fc55c4e7b43..09adce80e85 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -40421,7 +40421,7 @@ libpython is present and found at configure time.)  Python makes
 @value{GDBN} scripting much more powerful than the restricted CLI
 scripting language.  If your host does not have Python installed, you
 can find it on @url{http://www.python.org/download/}.  The oldest version
-of Python supported by GDB is 3.0.1.  The optional argument @var{python}
+of Python supported by GDB is 3.4.  The optional argument @var{python}
 is used to find the Python headers and libraries.  It can be either
 the name of a Python executable, or the name of the directory in which
 Python is installed.
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
index 124cec8055d..698f6cad038 100644
--- a/gdb/python/py-gdb-readline.c
+++ b/gdb/python/py-gdb-readline.c
@@ -30,11 +30,7 @@
 
 static char *
 gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
-#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 4
 			const char *prompt)
-#else
-			char *prompt)
-#endif
 {
   int n;
   const char *p = NULL;
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 93217375cc5..83fb9b79453 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -123,17 +123,6 @@ typedef unsigned long gdb_py_ulongest;
 
 #endif /* HAVE_LONG_LONG */
 
-#if PY_VERSION_HEX < 0x03020000
-typedef long Py_hash_t;
-#endif
-
-/* PyMem_RawMalloc appeared in Python 3.4.  For earlier versions, we can just
-   fall back to PyMem_Malloc.  */
-
-#if PY_VERSION_HEX < 0x03040000
-#define PyMem_RawMalloc PyMem_Malloc
-#endif
-
 /* PyObject_CallMethod's 'method' and 'format' parameters were missing
    the 'const' qualifier before Python 3.4.  Hence, we wrap the
    function in our own version to avoid errors with string literals.
-- 
2.40.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-07  9:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 16:33 [RFC] Bump minimum Python version to 3.4 Tom Tromey
2023-06-02 18:01 ` Simon Marchi
2023-06-02 18:14 ` Eli Zaretskii
2023-06-02 18:20   ` Paul Koning
2023-06-02 18:42     ` Eli Zaretskii
2023-06-03  0:01 ` Kevin Buettner
2023-06-07  9:41 ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).