Skip to content

Commit 8326596

Browse files
Merge branch 'main' into fix-dict-getitemref-error-docs
2 parents 3a0b666 + 5b58fbc commit 8326596

12 files changed

Lines changed: 46 additions & 53 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,15 @@ Misc/libabigail.abignore @encukou
156156
# ----------------------------------------------------------------------------
157157

158158
# Android
159-
Android/ @mhsmith @freakboy3742
159+
Platforms/Android/ @mhsmith @freakboy3742
160160
Doc/using/android.rst @mhsmith @freakboy3742
161161
Lib/_android_support.py @mhsmith @freakboy3742
162162
Lib/test/test_android.py @mhsmith @freakboy3742
163163

164164
# iOS
165165
Doc/using/ios.rst @freakboy3742
166166
Lib/_ios_support.py @freakboy3742
167-
Apple/ @freakboy3742
168-
iOS/ @freakboy3742
167+
Platforms/Apple/ @freakboy3742
169168

170169
# macOS
171170
Mac/ @python/macos-team

Doc/whatsnew/3.16.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ module_name
106106
Removed
107107
=======
108108

109+
annotationlib
110+
-------------
111+
112+
* The :meth:`!annotationlib.ForwardRef._evaluate` method
113+
which has been deprecated since Python 3.14.
114+
Use :meth:`annotationlib.ForwardRef.evaluate`
115+
or :func:`typing.evaluate_forward_ref` instead.
116+
109117
sysconfig
110118
---------
111119

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/annotationlib.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -226,29 +226,6 @@ def evaluate(
226226
new_locals.transmogrify(self.__cell__)
227227
return result
228228

229-
def _evaluate(self, globalns, localns, type_params=_sentinel, *, recursive_guard):
230-
import typing
231-
import warnings
232-
233-
if type_params is _sentinel:
234-
typing._deprecation_warning_for_no_type_params_passed(
235-
"typing.ForwardRef._evaluate"
236-
)
237-
type_params = ()
238-
warnings._deprecated(
239-
"ForwardRef._evaluate",
240-
"{name} is a private API and is retained for compatibility, but will be removed"
241-
" in Python 3.16. Use ForwardRef.evaluate() or typing.evaluate_forward_ref() instead.",
242-
remove=(3, 16),
243-
)
244-
return typing.evaluate_forward_ref(
245-
self,
246-
globals=globalns,
247-
locals=localns,
248-
type_params=type_params,
249-
_recursive_guard=recursive_guard,
250-
)
251-
252229
@property
253230
def __forward_arg__(self):
254231
if self.__arg__ is not None:

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

Lib/typing.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -434,19 +434,6 @@ def _rebuild_generic_alias(alias: GenericAlias, args: tuple[object, ...]) -> Gen
434434
return t
435435

436436

437-
def _deprecation_warning_for_no_type_params_passed(funcname: str) -> None:
438-
import warnings
439-
440-
depr_message = (
441-
f"Failing to pass a value to the 'type_params' parameter "
442-
f"of {funcname!r} is deprecated, as it leads to incorrect behaviour "
443-
f"when calling {funcname} on a stringified annotation "
444-
f"that references a PEP 695 type parameter. "
445-
f"It will be disallowed in Python 3.15."
446-
)
447-
warnings.warn(depr_message, category=DeprecationWarning, stacklevel=3)
448-
449-
450437
def _eval_type(t, globalns, localns, type_params, *, recursive_guard=frozenset(),
451438
format=None, owner=None, parent_fwdref=None, prefer_fwd_module=False):
452439
"""Evaluate all forward references in the given type t.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove ``annotationlib.ForwardRef._evaludate`` deprecated method.

Modules/_remote_debugging/threads.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,14 @@ unwind_stack_for_thread(
450450
set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to collect frames");
451451
goto error;
452452
}
453-
// Update last_profiled_frame for next sample
454-
uintptr_t lpf_addr =
455-
*current_tstate + (uintptr_t)unwinder->debug_offsets.thread_state.last_profiled_frame;
456-
if (_Py_RemoteDebug_WriteRemoteMemory(&unwinder->handle, lpf_addr,
457-
sizeof(uintptr_t), &frame_addr) < 0) {
458-
PyErr_Clear(); // Non-fatal
453+
// Update last_profiled_frame for next sample if it changed
454+
if (frame_addr != ctx.last_profiled_frame) {
455+
uintptr_t lpf_addr =
456+
*current_tstate + (uintptr_t)unwinder->debug_offsets.thread_state.last_profiled_frame;
457+
if (_Py_RemoteDebug_WriteRemoteMemory(&unwinder->handle, lpf_addr,
458+
sizeof(uintptr_t), &frame_addr) < 0) {
459+
PyErr_Clear(); // Non-fatal
460+
}
459461
}
460462
} else {
461463
// No caching - process entire frame chain with base_frame validation

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
{

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)