Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions Include/cpython/modsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ typedef struct _PyArg_Parser {
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
struct _PyArg_Parser *, ...);

#ifdef Py_BUILD_CORE
// Internal; defined here to avoid explicitly including pycore_modsupport.h
#define _Py_INTERNAL_ABI_SLOT \
{Py_mod_abi, (void*) &(PyABIInfo) { \
.abiinfo_major_version = 1, \
.abiinfo_minor_version = 0, \
.flags = PyABIInfo_INTERNAL, \
.build_version = PY_VERSION_HEX, \
.abi_version = PY_VERSION_HEX }} \
///////////////////////////////////////////////////////
#endif
// For internal use in stdlib. Needs C99 compound literals.
// Defined here to avoid every stdlib module including pycore_modsupport.h
#define _Py_ABI_SLOT {Py_mod_abi, (void*) &(PyABIInfo) _PyABIInfo_DEFAULT}
1 change: 1 addition & 0 deletions Modules/_abc.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ _abcmodule_free(void *module)
}

static PyModuleDef_Slot _abcmodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _abcmodule_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -4394,6 +4394,7 @@ module_exec(PyObject *mod)
}

static struct PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
Copy link
Contributor

@kumaraditya303 kumaraditya303 Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_asyncio is a builtin module as it is statically linked, this check is not needed as it is not a shared library module.

{Py_mod_exec, module_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_bisectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ bisect_modexec(PyObject *m)
}

static PyModuleDef_Slot bisect_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, bisect_modexec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_bz2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ _bz2_free(void *module)
}

static struct PyModuleDef_Slot _bz2_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _bz2_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_codecsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ static PyMethodDef _codecs_functions[] = {
};

static PyModuleDef_Slot _codecs_slots[] = {
_Py_ABI_SLOT,
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
{0, NULL}
Expand Down
1 change: 1 addition & 0 deletions Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2873,6 +2873,7 @@ collections_exec(PyObject *module) {
#undef ADD_TYPE

static struct PyModuleDef_Slot collections_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, collections_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,7 @@ csv_exec(PyObject *module) {
}

static PyModuleDef_Slot csv_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, csv_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -6497,6 +6497,7 @@ module_free(void *module)
}

static PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _ctypes_mod_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_curses_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ _curses_panel_exec(PyObject *mod)
}

static PyModuleDef_Slot _curses_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _curses_panel_exec},
// XXX gh-103092: fix isolation.
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5631,6 +5631,7 @@ cursesmodule_exec(PyObject *module)
/* Initialization function for the module */

static PyModuleDef_Slot cursesmodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, cursesmodule_exec},
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
2 changes: 1 addition & 1 deletion Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7656,7 +7656,7 @@ _datetime_exec(PyObject *module)
}

static PyModuleDef_Slot module_slots[] = {
_Py_INTERNAL_ABI_SLOT,
_Py_ABI_SLOT,
{Py_mod_exec, _datetime_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_dbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ _dbm_module_free(void *module)
}

static PyModuleDef_Slot _dbmmodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _dbm_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_decimal/_decimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -8029,6 +8029,7 @@ decimal_free(void *module)
}

static struct PyModuleDef_Slot _decimal_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _decimal_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4530,6 +4530,7 @@ module_exec(PyObject *m)
}

static struct PyModuleDef_Slot elementtree_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, module_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,6 +2004,7 @@ _functools_free(void *module)
}

static struct PyModuleDef_Slot _functools_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _functools_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_gdbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ _gdbm_module_free(void *module)
}

static PyModuleDef_Slot _gdbm_module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _gdbm_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2899,6 +2899,7 @@ hashlib_constants(PyObject *module)
}

static PyModuleDef_Slot hashlib_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, hashlib_init_hashtable},
{Py_mod_exec, hashlib_init_HASH_type},
{Py_mod_exec, hashlib_init_HASHXOF_type},
Expand Down
1 change: 1 addition & 0 deletions Modules/_heapqmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ heapq_exec(PyObject *m)
}

static struct PyModuleDef_Slot heapq_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, heapq_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_interpchannelsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3605,6 +3605,7 @@ module_exec(PyObject *mod)
}

static struct PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, module_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_interpqueuesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,7 @@ module_exec(PyObject *mod)
}

static struct PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, module_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_interpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,7 @@ module_exec(PyObject *mod)
}

static struct PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, module_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_io/_iomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ iomodule_exec(PyObject *m)
}

static struct PyModuleDef_Slot iomodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, iomodule_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,7 @@ _json_exec(PyObject *module)
}

static PyModuleDef_Slot _json_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _json_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_localemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ _locale_exec(PyObject *module)
}

static struct PyModuleDef_Slot _locale_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _locale_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_lsprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ _lsprof_exec(PyObject *module)
}

static PyModuleDef_Slot _lsprofslots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _lsprof_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_lzmamodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,7 @@ static PyMethodDef lzma_methods[] = {
};

static PyModuleDef_Slot lzma_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, lzma_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_multiprocessing/multiprocessing.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ multiprocessing_exec(PyObject *module)
}

static PyModuleDef_Slot multiprocessing_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, multiprocessing_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_opcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ _opcode_exec(PyObject *m) {
}

static PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _opcode_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1981,6 +1981,7 @@ operator_exec(PyObject *module)


static struct PyModuleDef_Slot operator_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, operator_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_pickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -8240,6 +8240,7 @@ _pickle_exec(PyObject *m)
}

static PyModuleDef_Slot pickle_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _pickle_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,7 @@ static PyMethodDef module_methods[] = {
};

static PyModuleDef_Slot _posixsubprocess_slots[] = {
_Py_ABI_SLOT,
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
{0, NULL}
Expand Down
1 change: 1 addition & 0 deletions Modules/_queuemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ queuemodule_exec(PyObject *module)
}

static PyModuleDef_Slot queuemodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, queuemodule_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_randommodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ _random_exec(PyObject *module)
}

static PyModuleDef_Slot _random_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _random_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_remote_debugging/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,7 @@ static PyMethodDef remote_debugging_methods[] = {
};

static PyModuleDef_Slot remote_debugging_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _remote_debugging_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_sqlite/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ module_exec(PyObject *module)
}

static struct PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, module_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_sre/sre.c
Original file line number Diff line number Diff line change
Expand Up @@ -3466,6 +3466,7 @@ sre_exec(PyObject *m)
}

static PyModuleDef_Slot sre_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, sre_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7312,6 +7312,7 @@ sslmodule_init_lock(PyObject *module)
}

static PyModuleDef_Slot sslmodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, sslmodule_init_types},
{Py_mod_exec, sslmodule_init_exceptions},
{Py_mod_exec, sslmodule_init_socketapi},
Expand Down
1 change: 1 addition & 0 deletions Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -2753,6 +2753,7 @@ _structmodule_exec(PyObject *m)
}

static PyModuleDef_Slot _structmodule_slots[] = {
_Py_ABI_SLOT,
{Py_mod_exec, _structmodule_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_suggestions.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static PyMethodDef module_methods[] = {
};

static PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
{0, NULL},
Expand Down
1 change: 1 addition & 0 deletions Modules/_sysconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static struct PyMethodDef sysconfig_methods[] = {
};

static PyModuleDef_Slot sysconfig_slots[] = {
_Py_ABI_SLOT,
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
{0, NULL}
Expand Down
1 change: 1 addition & 0 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3532,6 +3532,7 @@ _testcapi_exec(PyObject *m)
PyABIInfo_VAR(abi_info);

static PyModuleDef_Slot _testcapi_slots[] = {
_Py_ABI_SLOT,
{Py_mod_abi, &abi_info},
{Py_mod_exec, _testcapi_exec},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
Expand Down
1 change: 1 addition & 0 deletions Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3048,6 +3048,7 @@ module_exec(PyObject *module)
PyABIInfo_VAR(abi_info);

static struct PyModuleDef_Slot module_slots[] = {
_Py_ABI_SLOT,
{Py_mod_abi, &abi_info},
{Py_mod_exec, module_exec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
Expand Down
Loading
Loading