Skip to content

Commit 75685a6

Browse files
authored
Merge branch 'main' into remote-debugging-last-profiled-frame
2 parents 1a07c4a + 49918f5 commit 75685a6

13 files changed

Lines changed: 57 additions & 69 deletions

File tree

Doc/whatsnew/3.16.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ module_name
106106
Removed
107107
=======
108108

109-
module_name
110-
-----------
109+
sysconfig
110+
---------
111+
112+
* The :func:`!sysconfig.expand_makefile_vars` function
113+
which has been deprecated since Python 3.14.
114+
Use the ``vars`` argument of :func:`sysconfig.get_paths` instead.
111115

112-
* TODO
113116
.. Add removals above alphabetically, not here at the end.
114117
115118
@@ -156,4 +159,3 @@ Deprecated C APIs
156159
157160
Removed C APIs
158161
--------------
159-

Include/internal/pycore_magic_number.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ Known values:
297297
Python 3.15a8 3664 (Fix __qualname__ for __annotate__ functions)
298298
Python 3.15a8 3665 (Add FOR_ITER_VIRTUAL and GET_ITER specializations)
299299
Python 3.15b1 3666 (Add SEND_VIRTUAL and SEND_ASYNC_GEN specializations)
300+
Python 3.16a0 3700 (Initial version)
300301
301302
302-
Python 3.16 will start with 3700
303+
Python 3.17 will start with 3750
303304
304305
Please don't copy-paste the same pre-release tag for new entries above!!!
305306
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.
310311
311312
*/
312313

313-
#define PYC_MAGIC_NUMBER 3666
314+
#define PYC_MAGIC_NUMBER 3700
314315
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
315316
(little-endian) and then appending b'\r\n'. */
316317
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_typeobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ extern PyObject* _Py_BaseObject_RichCompare(PyObject* self, PyObject* other, int
122122
extern PyObject* _Py_slot_tp_getattro(PyObject *self, PyObject *name);
123123
extern PyObject* _Py_slot_tp_getattr_hook(PyObject *self, PyObject *name);
124124

125+
extern int _PyType_HasSlotTpIternext(PyTypeObject *type);
126+
125127
extern PyTypeObject _PyBufferWrapper_Type;
126128

127129
PyAPI_FUNC(PyObject*) _PySuper_Lookup(PyTypeObject *su_type, PyObject *su_obj,

Lib/sysconfig/__init__.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -753,41 +753,3 @@ def get_python_version():
753753

754754
def _get_python_version_abi():
755755
return _PY_VERSION_SHORT + get_config_var("abi_thread")
756-
757-
758-
def expand_makefile_vars(s, vars):
759-
"""Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
760-
'string' according to 'vars' (a dictionary mapping variable names to
761-
values). Variables not present in 'vars' are silently expanded to the
762-
empty string. The variable values in 'vars' should not contain further
763-
variable expansions; if 'vars' is the output of 'parse_makefile()',
764-
you're fine. Returns a variable-expanded version of 's'.
765-
"""
766-
767-
import warnings
768-
warnings.warn(
769-
'sysconfig.expand_makefile_vars is deprecated and will be removed in '
770-
'Python 3.16. Use sysconfig.get_paths(vars=...) instead.',
771-
DeprecationWarning,
772-
stacklevel=2,
773-
)
774-
775-
import re
776-
777-
_findvar1_rx = r"\$\(([A-Za-z][A-Za-z0-9_]*)\)"
778-
_findvar2_rx = r"\${([A-Za-z][A-Za-z0-9_]*)}"
779-
780-
# This algorithm does multiple expansion, so if vars['foo'] contains
781-
# "${bar}", it will expand ${foo} to ${bar}, and then expand
782-
# ${bar}... and so forth. This is fine as long as 'vars' comes from
783-
# 'parse_makefile()', which takes care of such expansions eagerly,
784-
# according to make's variable expansion semantics.
785-
786-
while True:
787-
m = re.search(_findvar1_rx, s) or re.search(_findvar2_rx, s)
788-
if m:
789-
(beg, end) = m.span()
790-
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
791-
else:
792-
break
793-
return s

Lib/test/test_capi/test_opt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@ def testfunc(n, m):
598598
ex = get_first_executor(testfunc)
599599
self.assertIsNotNone(ex)
600600
uops = get_opnames(ex)
601-
self.assertIn("_ITER_NEXT_INLINE", uops)
601+
self.assertIn("_FOR_ITER_TIER_TWO", uops)
602+
self.assertNotIn("_ITER_NEXT_INLINE", uops)
602603

603604

604605
@requires_specialization
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Removed the :func:`!sysconfig.expand_makefile_vars` function which has been
2+
deprecated since Python 3.14. Use the ``vars`` argument of
3+
:func:`sysconfig.get_paths` instead.

Objects/typeobject.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11079,6 +11079,12 @@ slot_tp_iternext(PyObject *self)
1107911079
return vectorcall_method(&_Py_ID(__next__), stack, 1);
1108011080
}
1108111081

11082+
int
11083+
_PyType_HasSlotTpIternext(PyTypeObject *type)
11084+
{
11085+
return type->tp_iternext == slot_tp_iternext;
11086+
}
11087+
1108211088
static PyObject *
1108311089
slot_tp_descr_get(PyObject *self, PyObject *obj, PyObject *type)
1108411090
{

PC/launcher.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,7 @@ static PYC_MAGIC magic_values[] = {
12731273
{ 3550, 3599, L"3.13" },
12741274
{ 3600, 3649, L"3.14" },
12751275
{ 3650, 3699, L"3.15" },
1276+
{ 3700, 3749, L"3.16" },
12761277
{ 0 }
12771278
};
12781279

PC/pyconfig.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,21 +330,21 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
330330
the linking is explicitly handled */
331331
# if defined(Py_GIL_DISABLED)
332332
# if defined(Py_DEBUG)
333-
# pragma comment(lib,"python315t_d.lib")
333+
# pragma comment(lib,"python316t_d.lib")
334334
# elif defined(Py_LIMITED_API) || defined(Py_TARGET_ABI3T)
335335
# pragma comment(lib,"python3t.lib")
336336
# else
337-
# pragma comment(lib,"python315t.lib")
337+
# pragma comment(lib,"python316t.lib")
338338
# endif /* Py_DEBUG */
339339
# else /* Py_GIL_DISABLED */
340340
# if defined(Py_DEBUG)
341-
# pragma comment(lib,"python315_d.lib")
341+
# pragma comment(lib,"python316_d.lib")
342342
# elif defined(Py_TARGET_ABI3T)
343343
# pragma comment(lib,"python3t.lib")
344344
# elif defined(Py_LIMITED_API)
345345
# pragma comment(lib,"python3.lib")
346346
# else
347-
# pragma comment(lib,"python315.lib")
347+
# pragma comment(lib,"python316.lib")
348348
# endif /* Py_DEBUG */
349349
# endif /* Py_GIL_DISABLED */
350350
# endif /* _MSC_VER && !Py_NO_LINK_LIB */

Platforms/WASI/_build.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,8 @@ def wasi_sdk(context):
222222
if wasi_sdk_path := context.wasi_sdk_path:
223223
if not wasi_sdk_path.exists():
224224
raise ValueError(
225-
"WASI SDK not found; "
226-
"download from "
227-
"https://github.com/WebAssembly/wasi-sdk and/or "
228-
"specify via $WASI_SDK_PATH or --wasi-sdk"
225+
"WASI SDK not found at "
226+
f"{os.fsdecode(wasi_sdk_path)!r} (via --wasi-sdk)"
229227
)
230228
return wasi_sdk_path
231229

@@ -237,7 +235,8 @@ def wasi_sdk(context):
237235
wasi_sdk_path = pathlib.Path(wasi_sdk_path_env_var)
238236
if not wasi_sdk_path.exists():
239237
raise ValueError(
240-
f"WASI SDK not found at $WASI_SDK_PATH ({wasi_sdk_path})"
238+
f"WASI SDK not found at {os.fsdecode(wasi_sdk_path)!r} "
239+
"(via $WASI_SDK_PATH)"
241240
)
242241
else:
243242
opt_path = pathlib.Path("/opt")
@@ -272,6 +271,14 @@ def wasi_sdk(context):
272271
f" Found WASI SDK {major_version}, "
273272
f"but WASI SDK {wasi_sdk_version} is the supported version",
274273
)
274+
elif not wasi_sdk_path:
275+
raise ValueError(
276+
f"WASI SDK {wasi_sdk_version} not found; "
277+
"download from "
278+
"https://github.com/WebAssembly/wasi-sdk and install in "
279+
f"{os.fsdecode(opt_path)!r} or specify the SDK via "
280+
"$WASI_SDK_PATH or --wasi-sdk"
281+
)
275282

276283
# Cache the result.
277284
context.wasi_sdk_path = wasi_sdk_path

0 commit comments

Comments
 (0)