gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770)

Rename from _Py_INTERNAL_ABI_SLOT to _Py_ABI_SLOT
and define the macro using _PyABIInfo_DEFAULT.

Use the ABI slot in stdlib extension modules to enable running
a check of ABI version compatibility.

_tkinter, _tracemalloc and readline don't use the slots, hence they need
explicit handling.

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Karolina Surma 2026-03-24 18:47:55 +01:00 committed by GitHub
parent 119fce7b88
commit 1887a95f51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
96 changed files with 128 additions and 10 deletions

View file

@ -400,6 +400,7 @@ static PyMethodDef tokenize_methods[] = {
};
static PyModuleDef_Slot tokenizemodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, tokenizemodule_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},