https://github.com/python/cpython/commit/9d07159cda9390c5714d46447ca918bae9fb8dcb
commit: 9d07159cda9390c5714d46447ca918bae9fb8dcb
branch: main
author: Stan Ulbrych <[email protected]>
committer: zware <[email protected]>
date: 2026-05-07T19:06:37Z
summary:

gh-149499: Fixes for 3.16 bump (GH-149500)

Also fixes gh-149507, regenerating `configure` for 3.16.

Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Zachary Ware <[email protected]>

files:
A Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst
M Doc/whatsnew/3.16.rst
M Include/internal/pycore_magic_number.h
M Lib/sysconfig/__init__.py
M PC/launcher.c
M PC/pyconfig.h
M configure

diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst
index 5931586d5a1d9c..cc88a694608233 100644
--- a/Doc/whatsnew/3.16.rst
+++ b/Doc/whatsnew/3.16.rst
@@ -106,10 +106,13 @@ module_name
 Removed
 =======
 
-module_name
------------
+sysconfig
+---------
+
+* The :func:`!sysconfig.expand_makefile_vars` function
+  which has been deprecated since Python 3.14.
+  Use the ``vars`` argument of :func:`sysconfig.get_paths` instead.
 
-* TODO
 .. Add removals above alphabetically, not here at the end.
 
 
@@ -156,4 +159,3 @@ Deprecated C APIs
 
 Removed C APIs
 --------------
-
diff --git a/Include/internal/pycore_magic_number.h 
b/Include/internal/pycore_magic_number.h
index 177938e3cdb5eb..0f1af8ba338865 100644
--- a/Include/internal/pycore_magic_number.h
+++ b/Include/internal/pycore_magic_number.h
@@ -297,9 +297,10 @@ Known values:
     Python 3.15a8 3664 (Fix __qualname__ for __annotate__ functions)
     Python 3.15a8 3665 (Add FOR_ITER_VIRTUAL and GET_ITER specializations)
     Python 3.15b1 3666 (Add SEND_VIRTUAL and SEND_ASYNC_GEN specializations)
+    Python 3.16a0 3700 (Initial version)
 
 
-    Python 3.16 will start with 3700
+    Python 3.17 will start with 3750
 
     Please don't copy-paste the same pre-release tag for new entries above!!!
     You should always use the *upcoming* tag. For example, if 3.12a6 came out
@@ -310,7 +311,7 @@ PC/launcher.c must also be updated.
 
 */
 
-#define PYC_MAGIC_NUMBER 3666
+#define PYC_MAGIC_NUMBER 3700
 /* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
    (little-endian) and then appending b'\r\n'. */
 #define PYC_MAGIC_NUMBER_TOKEN \
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index 47415adce04c2c..298256a5b23a9c 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -753,41 +753,3 @@ def get_python_version():
 
 def _get_python_version_abi():
     return _PY_VERSION_SHORT + get_config_var("abi_thread")
-
-
-def expand_makefile_vars(s, vars):
-    """Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
-    'string' according to 'vars' (a dictionary mapping variable names to
-    values).  Variables not present in 'vars' are silently expanded to the
-    empty string.  The variable values in 'vars' should not contain further
-    variable expansions; if 'vars' is the output of 'parse_makefile()',
-    you're fine.  Returns a variable-expanded version of 's'.
-    """
-
-    import warnings
-    warnings.warn(
-        'sysconfig.expand_makefile_vars is deprecated and will be removed in '
-        'Python 3.16. Use sysconfig.get_paths(vars=...) instead.',
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    import re
-
-    _findvar1_rx = r"\$\(([A-Za-z][A-Za-z0-9_]*)\)"
-    _findvar2_rx = r"\${([A-Za-z][A-Za-z0-9_]*)}"
-
-    # This algorithm does multiple expansion, so if vars['foo'] contains
-    # "${bar}", it will expand ${foo} to ${bar}, and then expand
-    # ${bar}... and so forth.  This is fine as long as 'vars' comes from
-    # 'parse_makefile()', which takes care of such expansions eagerly,
-    # according to make's variable expansion semantics.
-
-    while True:
-        m = re.search(_findvar1_rx, s) or re.search(_findvar2_rx, s)
-        if m:
-            (beg, end) = m.span()
-            s = s[0:beg] + vars.get(m.group(1)) + s[end:]
-        else:
-            break
-    return s
diff --git 
a/Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst 
b/Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst
new file mode 100644
index 00000000000000..796d39f5ba05bf
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst
@@ -0,0 +1,3 @@
+Removed the :func:`!sysconfig.expand_makefile_vars` function which has been
+deprecated since Python 3.14. Use the ``vars`` argument of
+:func:`sysconfig.get_paths` instead.
diff --git a/PC/launcher.c b/PC/launcher.c
index fed5e156b92cb3..5667fc851aa590 100644
--- a/PC/launcher.c
+++ b/PC/launcher.c
@@ -1273,6 +1273,7 @@ static PYC_MAGIC magic_values[] = {
     { 3550, 3599, L"3.13" },
     { 3600, 3649, L"3.14" },
     { 3650, 3699, L"3.15" },
+    { 3700, 3749, L"3.16" },
     { 0 }
 };
 
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 72a475777b7ad0..2381ed3772b109 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -330,21 +330,21 @@ Py_NO_ENABLE_SHARED to find out.  Also support 
MS_NO_COREDLL for b/w compat */
                         the linking is explicitly handled */
 #                       if defined(Py_GIL_DISABLED)
 #                       if defined(Py_DEBUG)
-#                               pragma comment(lib,"python315t_d.lib")
+#                               pragma comment(lib,"python316t_d.lib")
 #                       elif defined(Py_LIMITED_API) || 
defined(Py_TARGET_ABI3T)
 #                               pragma comment(lib,"python3t.lib")
 #                       else
-#                               pragma comment(lib,"python315t.lib")
+#                               pragma comment(lib,"python316t.lib")
 #                       endif /* Py_DEBUG */
 #                       else /* Py_GIL_DISABLED */
 #                       if defined(Py_DEBUG)
-#                               pragma comment(lib,"python315_d.lib")
+#                               pragma comment(lib,"python316_d.lib")
 #                       elif defined(Py_TARGET_ABI3T)
 #                               pragma comment(lib,"python3t.lib")
 #                       elif defined(Py_LIMITED_API)
 #                               pragma comment(lib,"python3.lib")
 #                       else
-#                               pragma comment(lib,"python315.lib")
+#                               pragma comment(lib,"python316.lib")
 #                       endif /* Py_DEBUG */
 #                       endif /* Py_GIL_DISABLED */
 #               endif /* _MSC_VER && !Py_NO_LINK_LIB */
diff --git a/configure b/configure
index cff7dfbfba8b9a..ecdd6095669ddc 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for python 3.15.
+# Generated by GNU Autoconf 2.72 for python 3.16.
 #
 # Report bugs to <https://github.com/python/cpython/issues/>.
 #
@@ -604,8 +604,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='python'
 PACKAGE_TARNAME='python'
-PACKAGE_VERSION='3.15'
-PACKAGE_STRING='python 3.15'
+PACKAGE_VERSION='3.16'
+PACKAGE_STRING='python 3.16'
 PACKAGE_BUGREPORT='https://github.com/python/cpython/issues/'
 PACKAGE_URL=''
 
@@ -1750,7 +1750,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-'configure' configures python 3.15 to adapt to many kinds of systems.
+'configure' configures python 3.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1816,7 +1816,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of python 3.15:";;
+     short | recursive ) echo "Configuration of python 3.16:";;
    esac
   cat <<\_ACEOF
 
@@ -1875,9 +1875,9 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-build-python=python3.15
+  --with-build-python=python3.16
                           path to build python binary for cross compiling
-                          (default: _bootstrap_python or python3.15)
+                          (default: _bootstrap_python or python3.16)
   --with-pkg-config=[yes|no|check]
                           use pkg-config to detect build options (default is
                           check)
@@ -2133,7 +2133,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-python configure 3.15
+python configure 3.16
 generated by GNU Autoconf 2.72
 
 Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2811,7 +2811,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by python $as_me 3.15, which was
+It was created by python $as_me 3.16, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3846,7 +3846,7 @@ fi
 
 
 
-for ac_prog in python$PACKAGE_VERSION python3.15 python3.14 python3.13 
python3.12 python3.11 python3.10 python3 python
+for ac_prog in python$PACKAGE_VERSION python3.16 python3.15 python3.14 
python3.13 python3.12 python3.11 python3.10 python3 python
 do
   # Extract the first word of "$ac_prog", so it can be a program name with 
args.
 set dummy $ac_prog; ac_word=$2
@@ -3922,7 +3922,7 @@ rm confdefs.h
 mv confdefs.h.new confdefs.h
 
 
-VERSION=3.15
+VERSION=3.16
 
 # Version number of Python's own shared library file.
 
@@ -35911,7 +35911,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by python $as_me 3.15, which was
+This file was extended by python $as_me 3.16, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -35975,7 +35975,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | 
sed "s/^ //; s/'/'\\\\\\\\
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-python config.status 3.15
+python config.status 3.16
 configured by $0, generated by GNU Autoconf 2.72,
   with options \\"\$ac_cs_config\\"
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to