mirror of
https://github.com/python/cpython.git
synced 2026-04-14 15:50:50 +00:00
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:
parent
119fce7b88
commit
1887a95f51
96 changed files with 128 additions and 10 deletions
1
Python/Python-ast.c
generated
1
Python/Python-ast.c
generated
|
|
@ -18480,6 +18480,7 @@ astmodule_exec(PyObject *m)
|
|||
}
|
||||
|
||||
static PyModuleDef_Slot astmodule_slots[] = {
|
||||
_Py_ABI_SLOT,
|
||||
{Py_mod_exec, astmodule_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ _contextvars_exec(PyObject *m)
|
|||
}
|
||||
|
||||
static struct PyModuleDef_Slot _contextvars_slots[] = {
|
||||
_Py_ABI_SLOT,
|
||||
{Py_mod_exec, _contextvars_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
|
|
|
|||
|
|
@ -1626,6 +1626,7 @@ warnings_module_exec(PyObject *module)
|
|||
|
||||
|
||||
static PyModuleDef_Slot warnings_slots[] = {
|
||||
_Py_ABI_SLOT,
|
||||
{Py_mod_exec, warnings_module_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
|
|
|
|||
|
|
@ -5714,6 +5714,7 @@ imp_module_exec(PyObject *module)
|
|||
|
||||
|
||||
static PyModuleDef_Slot imp_slots[] = {
|
||||
_Py_ABI_SLOT,
|
||||
{Py_mod_exec, imp_module_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
|
|
|
|||
|
|
@ -2135,6 +2135,7 @@ marshal_module_exec(PyObject *mod)
|
|||
}
|
||||
|
||||
static PyModuleDef_Slot marshalmodule_slots[] = {
|
||||
_Py_ABI_SLOT,
|
||||
{Py_mod_exec, marshal_module_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue