]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770)
authorKarolina Surma <33810531+befeleme@users.noreply.github.com>
Tue, 24 Mar 2026 17:47:55 +0000 (18:47 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Mar 2026 17:47:55 +0000 (17:47 +0000)
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>
96 files changed:
Include/cpython/modsupport.h
Modules/_abc.c
Modules/_asynciomodule.c
Modules/_bisectmodule.c
Modules/_bz2module.c
Modules/_codecsmodule.c
Modules/_collectionsmodule.c
Modules/_csv.c
Modules/_ctypes/_ctypes.c
Modules/_curses_panel.c
Modules/_cursesmodule.c
Modules/_datetimemodule.c
Modules/_dbmmodule.c
Modules/_decimal/_decimal.c
Modules/_elementtree.c
Modules/_functoolsmodule.c
Modules/_gdbmmodule.c
Modules/_hashopenssl.c
Modules/_heapqmodule.c
Modules/_interpchannelsmodule.c
Modules/_interpqueuesmodule.c
Modules/_interpretersmodule.c
Modules/_io/_iomodule.c
Modules/_json.c
Modules/_localemodule.c
Modules/_lsprof.c
Modules/_lzmamodule.c
Modules/_multiprocessing/multiprocessing.c
Modules/_opcode.c
Modules/_operator.c
Modules/_pickle.c
Modules/_posixsubprocess.c
Modules/_queuemodule.c
Modules/_randommodule.c
Modules/_remote_debugging/module.c
Modules/_sqlite/module.c
Modules/_sre/sre.c
Modules/_ssl.c
Modules/_struct.c
Modules/_suggestions.c
Modules/_sysconfig.c
Modules/_testmultiphase.c
Modules/_threadmodule.c
Modules/_tkinter.c
Modules/_tracemalloc.c
Modules/_typesmodule.c
Modules/_typingmodule.c
Modules/_weakref.c
Modules/_winapi.c
Modules/_xxtestfuzz/_xxtestfuzz.c
Modules/_zoneinfo.c
Modules/_zstd/_zstdmodule.c
Modules/arraymodule.c
Modules/atexitmodule.c
Modules/binascii.c
Modules/blake2module.c
Modules/cjkcodecs/cjkcodecs.h
Modules/cjkcodecs/multibytecodec.c
Modules/cmathmodule.c
Modules/faulthandler.c
Modules/fcntlmodule.c
Modules/gcmodule.c
Modules/grpmodule.c
Modules/hmacmodule.c
Modules/itertoolsmodule.c
Modules/mathintegermodule.c
Modules/mathmodule.c
Modules/md5module.c
Modules/mmapmodule.c
Modules/overlapped.c
Modules/posixmodule.c
Modules/pwdmodule.c
Modules/pyexpat.c
Modules/readline.c
Modules/resource.c
Modules/selectmodule.c
Modules/sha1module.c
Modules/sha2module.c
Modules/sha3module.c
Modules/signalmodule.c
Modules/socketmodule.c
Modules/symtablemodule.c
Modules/syslogmodule.c
Modules/timemodule.c
Modules/unicodedata.c
Modules/xxmodule.c
Modules/xxsubtype.c
Modules/zlibmodule.c
Objects/unicodeobject.c
Parser/asdl_c.py
Python/Python-ast.c
Python/Python-tokenize.c
Python/_contextvars.c
Python/_warnings.c
Python/import.c
Python/marshal.c

index b9f253e06b31c91f6a2f92fe0ce282c978bb5a08..cfeee6e8ab3414d758d857550e83f8b7fb11e489 100644 (file)
@@ -39,13 +39,7 @@ 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 }}                  \
-    ///////////////////////////////////////////////////////
+// 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}
 #endif
index f87a5c702946bc2af1131ebf35e262f4f4677e64..3c4e0280525e1ebe104c989c62ab73271d2708b4 100644 (file)
@@ -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},
index 8eb8e191530a3326a82bd3e9422d18b5c90426df..826c0b25a362c276bd2008bcd1358ab4885c7c8c 100644 (file)
@@ -4394,6 +4394,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},
index 3a1491e5b96f29b0cfac894cfc6c28a91c0be50e..329aa8e117ec3cf4686d8f8e8230b4c959fff912 100644 (file)
@@ -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},
index f3457a13c96c1f361781adc4aa22724106804e17..7b8cbf3ed961844980f6bee1da68194261e0177e 100644 (file)
@@ -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},
index 2f2edbb05ab5c5716ebc8726751b78a34e880776..ff52bfd8291ac14d0a1c4368559cdd79723cff68 100644 (file)
@@ -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}
index 15c9aa419118225836e78e029c236f5bb8250778..4ff05727ebc8ce34d0f2862100fc70040cc04355 100644 (file)
@@ -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},
index a3f840acbe8c0b7453494a5a8fad3bd3ba57adf7..9d6190a11c4b104289ed4582d4f6057f62e5e6fe 100644 (file)
@@ -1833,6 +1833,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},
index 2c691c3766fc4dd14ae4730f430a3bc68e2ca7cb..9a6f377fdb0ed51ba471d1674aa239822c39f3d6 100644 (file)
@@ -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},
index 3b46fdf838b16f8a4a6db2e63697866ab89f046f..83802605e1f4dc91814daf5b0065b902521795f8 100644 (file)
@@ -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},
index fe9d6fe2763f36086a8228aa6bea8354d70fc162..000d7318557a6e679de796000520cf6e4927f13c 100644 (file)
@@ -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},
index 9d803dc94b64c71a7b945fdde7d41dafc34fe83d..0db8bc675c4bb49584da6408a8c197758d4b9c0a 100644 (file)
@@ -7656,7 +7656,7 @@ finally:
 }
 
 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},
index f88861fa24423b774ded10a8763851ac3e7d0ac4..6b07ef74cfa51db8bc8c75c65ae4db4ef60468c0 100644 (file)
@@ -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},
index c42757e042e7ef47ae0c720a3eef703f960e7d12..b47014c4e7466dd1a3d77a82bb354b5b8176f804 100644 (file)
@@ -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},
index 721670ed99742e7ff833449d8fd5cbb8db5bddc6..ba909d15c2effd0d37334f6efc3e82d4ce06505f 100644 (file)
@@ -4533,6 +4533,7 @@ error:
 }
 
 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},
index 576494e846ca0c2179e49e3ae3c86096cd046865..19bdf3d47c2fad5ca1c1ef6c616b2a4ff4bf1302 100644 (file)
@@ -2018,6 +2018,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},
index 72f568ceb0698710e06a13358cdd597e460c098a..faffe8d28c5b5e7ed7e4bdf5e3d7d42a63bbd5c9 100644 (file)
@@ -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},
index e19eb1abcf2c4dde00d58c6ace259c1ce2b547b5..938a6ce5b962d14f6169ca3b8b9d72ced400871d 100644 (file)
@@ -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},
index 05d01acd77109bc42a85018893c7713af3a5ba9b..c705376f4edbf09c8a1253d1476e04667dbaba70 100644 (file)
@@ -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},
index 2933332ad465d4080763116822f49f5880d42abf..3c356cb40d2bca6e3f156deb30e4fbedc56e1b00 100644 (file)
@@ -3605,6 +3605,7 @@ error:
 }
 
 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},
index 417c5fbcee26458e8c72fc3cbea23723bdbd3716..777b68547498847927f181e7864d872dfde92a06 100644 (file)
@@ -1898,6 +1898,7 @@ error:
 }
 
 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},
index 2aee8b07891c9198ff57b06b28d8b93de44f917b..b65140e003b9c9a4bc18f19d9ba88480c7c734af 100644 (file)
@@ -1634,6 +1634,7 @@ error:
 }
 
 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},
index 433d68d515ccc64ef173d608c5873c2b2d274222..32c55f8e225ed91c81211d8012ef059fe819ff0c 100644 (file)
@@ -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},
index cbede8f44dc065be98dab9395cd10626aeef075f..f9c4f06bac7b43217131bfedc147115cf122c381 100644 (file)
@@ -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},
index 86a390e52a554bc16336f881cbbdd4cfec5fa226..8f7d662b00b21b5d370bb1a4b307184e20e2fd33 100644 (file)
@@ -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},
index a2d1aefb1611b36e4299bec88f2a204b761612d2..abb8db1acabbd5ef01bc52e74da517bbb0402952 100644 (file)
@@ -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},
index cd0d09682fac69c879a11e8a2f1ec709cfefd200..3c391675d7b93e70bae1260a71e51acdf6e7c1a3 100644 (file)
@@ -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},
index 848784dedc17027c8b945dbb818b931eec4f1e76..201cedbb59818f2dce45087f8899fa9d54bc7b1c 100644 (file)
@@ -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},
index 2fe09593a457e9b5857481d3fbb9cf5ee95f782f..dedf17f76dfc9b7c372a2e6f1a24d4e8225d331a 100644 (file)
@@ -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},
index 1cc05c39f5dbad13280014a070445884d27e4781..d04732dc314f11027c3b7d93ff5989f3b15b8e38 100644 (file)
@@ -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},
index 65facaa6db20368d406359296b4bc360590d3ed3..a55e04290b8fddd41d45076fea1d9a45469cca33 100644 (file)
@@ -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},
index 6f0a6d1d4e37fea3e47e1d2ea210aa04c68ec8e8..b7f39ea3d499e4cae355ae29b8053f6d683ce59a 100644 (file)
@@ -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}
index f2246dd36cf110c8d7de786281be5bea25ba7617..ed925f3525a9a7db62678980ac58a977369b98c2 100644 (file)
@@ -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},
index 544e636d18fede9a2cafec5a9f8413b7c0253ff0..0fb73481651748506c035fe576dfb40e2835b127 100644 (file)
@@ -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},
index 2aa9e500c608e85603d2980f1313ade94470dad7..f86bbf8ce5526e46827932762bbf4743102c336a 100644 (file)
@@ -1840,6 +1840,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},
index 831dd9219f77aba8224de728d9f9400d18713014..512d9744d57416e542a94bebfc1cd343ab0f2ee3 100644 (file)
@@ -778,6 +778,7 @@ error:
 }
 
 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},
index d6cdd861fd85a2b6f6bd55267c4c9f0dc79feb42..54de09a7d773dc3e584e2c2ac75c9bb6dbd278a0 100644 (file)
@@ -3466,6 +3466,7 @@ error:
 }
 
 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},
index 2eb31229a9bf3c2f64b780f443a71d8c806fdace..b45295b4c0cad7b171951b8c9bccaf30a9283cde 100644 (file)
@@ -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},
index 2059218029ea34ae3f08bc5d1879bba5bdb3b3c7..1f1b44b2d4416594ab64047739796475293fd010 100644 (file)
@@ -2881,6 +2881,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},
index fb588de78085fe3ec1b6898ca98be3d49c0bcc25..db1efa7841f995aef81e65b86dde89f4579e46f0 100644 (file)
@@ -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},
index bcb9d108174f4390d396249aed6af4c8edf78ad9..ff22739610e794d316dbde99cbfc8c59243c2fa6 100644 (file)
@@ -127,6 +127,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}
index e286eaae820b2b1a075456a5650bf20d140000a2..4921dc90713dafdf9ef0e6b8e1d7751a473d1c09 100644 (file)
@@ -435,6 +435,7 @@ static int execfunc(PyObject *m)
 }
 
 static PyModuleDef_Slot main_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, execfunc},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
@@ -481,6 +482,7 @@ createfunc_nonmodule(PyObject *spec, PyModuleDef *def)
 }
 
 static PyModuleDef_Slot slots_create_nonmodule[] = {
+    _Py_ABI_SLOT,
     {Py_mod_create, createfunc_nonmodule},
     {0, NULL},
 };
@@ -527,6 +529,7 @@ PyInit__testmultiphase_nonmodule_with_methods(void)
 /**** Non-ASCII-named modules ****/
 
 static PyModuleDef_Slot nonascii_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
     {0, NULL},
 };
@@ -689,6 +692,7 @@ createfunc_noop(PyObject *spec, PyModuleDef *def)
 }
 
 static PyModuleDef_Slot slots_multiple_create_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_create, createfunc_noop},
     {Py_mod_create, createfunc_noop},
     {0, NULL},
@@ -710,6 +714,7 @@ createfunc_null(PyObject *spec, PyModuleDef *def)
 }
 
 static PyModuleDef_Slot slots_create_null[] = {
+    _Py_ABI_SLOT,
     {Py_mod_create, createfunc_null},
     {0, NULL},
 };
@@ -752,6 +757,7 @@ createfunc_unreported_exception(PyObject *spec, PyModuleDef *def)
 }
 
 static PyModuleDef_Slot slots_create_unreported_exception[] = {
+    _Py_ABI_SLOT,
     {Py_mod_create, createfunc_unreported_exception},
     {0, NULL},
 };
@@ -766,6 +772,7 @@ PyInit__testmultiphase_create_unreported_exception(void)
 }
 
 static PyModuleDef_Slot slots_nonmodule_with_exec_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_create, createfunc_nonmodule},
     {Py_mod_exec, execfunc},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
@@ -789,6 +796,7 @@ execfunc_err(PyObject *mod)
 }
 
 static PyModuleDef_Slot slots_exec_err[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, execfunc_err},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
@@ -812,6 +820,7 @@ execfunc_raise(PyObject *spec)
 }
 
 static PyModuleDef_Slot slots_exec_raise[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, execfunc_raise},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
@@ -835,6 +844,7 @@ execfunc_unreported_exception(PyObject *mod)
 }
 
 static PyModuleDef_Slot slots_exec_unreported_exception[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, execfunc_unreported_exception},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
@@ -893,6 +903,7 @@ meth_state_access_exec(PyObject *m)
 }
 
 static PyModuleDef_Slot meth_state_access_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, meth_state_access_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
@@ -943,6 +954,7 @@ PyInit__test_module_state_shared(void)
 /* multiple interpreters support */
 
 static PyModuleDef_Slot slots_multiple_multiple_interpreters_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
@@ -961,6 +973,7 @@ PyInit__testmultiphase_multiple_multiple_interpreters_slots(void)
 }
 
 static PyModuleDef_Slot non_isolated_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, execfunc},
     {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
@@ -979,6 +992,7 @@ PyInit__test_non_isolated(void)
 
 
 static PyModuleDef_Slot shared_gil_only_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, execfunc},
     /* Note that Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED is the default.
        We put it here explicitly to draw attention to the contrast
@@ -1000,6 +1014,7 @@ PyInit__test_shared_gil_only(void)
 
 
 static PyModuleDef_Slot no_multiple_interpreter_slot_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, execfunc},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
     {0, NULL},
index 73eff27343618cca0737d94c6abd79ac3b52fa78..529257c2aa78aa152992252bdf28af9296cb616c 100644 (file)
@@ -2857,6 +2857,7 @@ PyDoc_STRVAR(thread_doc,
 The 'threading' module provides a more convenient interface.");
 
 static PyModuleDef_Slot thread_module_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, thread_module_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 1524d02d9e5a5edce62a89751d0e056e3fb927ee..bbe2a428454e0cc79c1b834851db340558702a28 100644 (file)
@@ -3476,6 +3476,11 @@ static struct PyModuleDef _tkintermodule = {
 PyMODINIT_FUNC
 PyInit__tkinter(void)
 {
+    PyABIInfo_VAR(abi_info);
+    if (PyABIInfo_Check(&abi_info, "_tkinter") < 0) {
+        return NULL;
+    }
+
     PyObject *m, *uexe, *cexe;
 
     tcl_lock = PyThread_allocate_lock();
index 21baa6ea003884dfe6ce305b75f0021d522f11d4..56d83ea0dcb2a7dcdbe604d4e1cfb9522ce34bd5 100644 (file)
@@ -216,6 +216,11 @@ static struct PyModuleDef module_def = {
 PyMODINIT_FUNC
 PyInit__tracemalloc(void)
 {
+    PyABIInfo_VAR(abi_info);
+    if (PyABIInfo_Check(&abi_info, "_tracemalloc") < 0) {
+        return NULL;
+    }
+
     PyObject *mod = PyModule_Create(&module_def);
     if (mod == NULL) {
         return NULL;
index 6c9e7a0a3ba053a008d8e62fc947e2f692b2ecd7..232c6cd46d1aa83da5da6fb1b74f3df077e37189 100644 (file)
@@ -54,6 +54,7 @@ _types_exec(PyObject *m)
 }
 
 static struct PyModuleDef_Slot _typesmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _types_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index e51279c808a2e10565ec3c3a17872c8b12d04c33..9f698d3e48d5f0c078172e20790856873565bc61 100644 (file)
@@ -74,6 +74,7 @@ _typing_exec(PyObject *m)
 }
 
 static struct PyModuleDef_Slot _typingmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _typing_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index ecaa08ff60f2034dbf7c60cf10d129ce0ee0d5b4..623252728554f7a55a2ce043fdce7a0a446020c4 100644 (file)
@@ -162,6 +162,7 @@ weakref_exec(PyObject *module)
 }
 
 static struct PyModuleDef_Slot weakref_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, weakref_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 985706737c5a36e7ce9fdffec9d975c9174b14be..ffa407b2f21f733b8a7db7cd4ef14ced50530ec5 100644 (file)
@@ -3328,6 +3328,7 @@ static int winapi_exec(PyObject *m)
 }
 
 static PyModuleDef_Slot winapi_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, winapi_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 0e0ca5f95fa449ff4b9713e1fceb4a7033e8b8d3..a2f01eb249013519c0f650eba614121075faf5d0 100644 (file)
@@ -28,7 +28,10 @@ static PyMethodDef module_methods[] = {
     {NULL},
 };
 
+PyABIInfo_VAR(abi_info);
+
 static PyModuleDef_Slot module_slots[] = {
+    {Py_mod_abi, &abi_info},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
     {0, NULL},
 };
index f37f195735b67e2412f1599c8cdbdbb6016e5878..159cac3c06601a6c17e5e8b5bf7f4f1ea41be21b 100644 (file)
@@ -2795,6 +2795,7 @@ error:
 }
 
 static PyModuleDef_Slot zoneinfomodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, zoneinfomodule_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 25ededd03a380a9147b289a0e67e84b8d723c522..94246dd93b17de1075ef95dda9217c91f2310480 100644 (file)
@@ -744,6 +744,7 @@ _zstd_free(void *module)
 }
 
 static struct PyModuleDef_Slot _zstd_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _zstd_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 8ce17fea8b415793365d7bc22cc8a637efae2051..9381aa5eced90f49ae6810c73bcd625da3acbb75 100644 (file)
@@ -3324,6 +3324,7 @@ array_modexec(PyObject *m)
 }
 
 static PyModuleDef_Slot arrayslots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, array_modexec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 3ddbbd59a1ef0c3146fe4d4e24ebe656ff40986f..177b09d3dafbd9323924927922d43846ab26212f 100644 (file)
@@ -341,6 +341,7 @@ Two public functions, register and unregister, are defined.\n\
 ");
 
 static PyModuleDef_Slot atexitmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
     {0, NULL}
index 64a18e23967d455faedcaaddd315ac2469a7aeb0..dbe77ff248d34efd8965ca96b9059673f3e4df10 100644 (file)
@@ -2544,6 +2544,7 @@ binascii_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot binascii_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, binascii_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index bb3b934be69dd7d3c0d4e85a7c50a8fe92913f14..b71dd20925611efb9eed66743e3fc4484ca60ea6 100644 (file)
@@ -280,6 +280,7 @@ blake2_exec(PyObject *m)
 }
 
 static PyModuleDef_Slot _blake2_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, blake2_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index f66412237011d4252de9985af5e5022de8c2ba62..9d86396f73b2b55a708289a7fdce7dbda99dc8a2 100644 (file)
@@ -500,6 +500,7 @@ static struct PyMethodDef _cjk_methods[] = {
 };
 
 static PyModuleDef_Slot _cjk_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _cjk_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index a7fac2380f251988ff0dc3884c4cd648ba51179b..d774a4968b883631955eea764fd2bbade808b32e 100644 (file)
@@ -2121,6 +2121,7 @@ static struct PyMethodDef _multibytecodec_methods[] = {
 };
 
 static PyModuleDef_Slot _multibytecodec_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _multibytecodec_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 65fbcf5cdaa73fe5dc3bddc2cfba9addcc169ff7..1e9f9ae051a0b120de9219697b4adde586fe3cea 100644 (file)
@@ -1293,6 +1293,7 @@ cmath_exec(PyObject *mod)
 }
 
 static PyModuleDef_Slot cmath_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, cmath_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 9b8c77e2b0401f8d54f8d83b6dd56b2bbc674bb4..bc7731c2588dc019c459e74802ba8ad5b5afd21f 100644 (file)
@@ -1422,6 +1422,7 @@ PyExec_faulthandler(PyObject *module) {
 }
 
 static PyModuleDef_Slot faulthandler_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, PyExec_faulthandler},
     // XXX gh-103092: fix isolation.
     //{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
index ce636c574ed5ffa7c910febe60b2de2d3fa91c23..e6a40ffc5a26144e279eb39f9285417fbde02084 100644 (file)
@@ -835,6 +835,7 @@ fcntl_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot fcntl_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, fcntl_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 4c286f5c12cc7ddfc31a8f1ec8e4ace34670866f..0da8cd5b418acaf57bacacaaddc509852e7d8e79 100644 (file)
@@ -538,6 +538,7 @@ gcmodule_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot gcmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, gcmodule_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 652958618a2c4c8b8e38f36ca3572883c4dfe66c..32ead25980361462ee84503aa799fe2db3e14f9c 100644 (file)
@@ -370,6 +370,7 @@ grpmodule_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot grpmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, grpmodule_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 1a212fa3d37e18dfa3abfd16511d70bc8c759463..b39a8f99ed91e8246da46d9e58b98b19132c2b97 100644 (file)
@@ -1690,6 +1690,7 @@ hmacmodule_free(void *mod)
 }
 
 static struct PyModuleDef_Slot hmacmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, hmacmodule_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index b37256c7928badd8ddedd02b2dd295f2f22fc1ef..48f1d1c7fde17bd615081bc4b6966e3b5c6ecb23 100644 (file)
@@ -4121,6 +4121,7 @@ itertoolsmodule_exec(PyObject *mod)
 }
 
 static struct PyModuleDef_Slot itertoolsmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, itertoolsmodule_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index de5f619c9d065ca2db1b0e230b10051a1b49bc55..cfad4154b2d361126d20bc9d11497a16c7c84f48 100644 (file)
@@ -1268,6 +1268,7 @@ math_integer_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot math_integer_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, math_integer_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 11c46c987e146a6b383128839821b84d6fe682e1..6b7fc004d0d858fbd22527a47bdedc537ce16559 100644 (file)
@@ -3103,6 +3103,7 @@ static PyMethodDef math_methods[] = {
 };
 
 static PyModuleDef_Slot math_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, math_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index e598b1fe67240dc70ee7c35eae0fc42c28ba7c81..063be1405dd51f42491c1317af6ebac03a52e033 100644 (file)
@@ -365,6 +365,7 @@ md5_exec(PyObject *m)
 }
 
 static PyModuleDef_Slot _md5_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, md5_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 61d8a043a04ce22c6b87320a003d4b73c870b82a..a30afe91f8fa171214058ca3609cebc5c85bfaa8 100644 (file)
@@ -2432,6 +2432,7 @@ mmap_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot mmap_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, mmap_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 8c3575ff5678ebecab853e996e9a4616efa54ade..8d2bd87ddb3c2ed5ad5057e3f60aa388dccac87b 100644 (file)
@@ -2073,6 +2073,7 @@ overlapped_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot overlapped_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, overlapped_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 157965195e1fa00a0783f7f93541f86eebe0324b..07c2b73575f14e53688eb1cd3a05496b7ffb053b 100644 (file)
@@ -18815,6 +18815,7 @@ posixmodule_exec(PyObject *m)
 
 
 static PyModuleDef_Slot posixmodile_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, posixmodule_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index a18737b24c29e90519a09919cc0c8514c32a2aec..4a2b33f8700d1010520070245a233b8d5ad4f28b 100644 (file)
@@ -372,6 +372,7 @@ pwdmodule_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot pwdmodule_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, pwdmodule_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 782e552f342b17dae4997f9e3455a6d3dbc6acc4..31b883fe8bd5483e5c826aaf2ae62a74b7137562 100644 (file)
@@ -2464,6 +2464,7 @@ pyexpat_free(void *module)
 }
 
 static PyModuleDef_Slot pyexpat_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, pyexpat_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 579a34b02ceb672891b510366eb7c392e4d80660..488332f548e5fe335c5dbf1cc3c98f9747633fa2 100644 (file)
@@ -1626,6 +1626,11 @@ static struct PyModuleDef readlinemodule = {
 PyMODINIT_FUNC
 PyInit_readline(void)
 {
+    PyABIInfo_VAR(abi_info);
+    if (PyABIInfo_Check(&abi_info, "readline") < 0) {
+        return NULL;
+    }
+
     const char *backend = "readline";
     PyObject *m;
     readlinestate *mod_state;
index a463355f424d485059632035a763463790c95d51..9bf8d2782766ccb5bf140245b6c60a2de79b519b 100644 (file)
@@ -560,6 +560,7 @@ resource_exec(PyObject *module)
 }
 
 static struct PyModuleDef_Slot resource_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, resource_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 4dd544c6ee8d34027bf76b7e69814a619e124f39..32bd9ab0873ea10ec47cba41dc2d5f33edfa605e 100644 (file)
@@ -2912,6 +2912,7 @@ _select_exec(PyObject *m)
 }
 
 static PyModuleDef_Slot _select_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _select_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 89e66240d1d11f443e702aef3fbacddfab871f9d..5681780b569b6cb1a36c9bbafad7fe824c527320 100644 (file)
@@ -369,6 +369,7 @@ _sha1_exec(PyObject *module)
 /* Initialize this module. */
 
 static PyModuleDef_Slot _sha1_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _sha1_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 9453b0be512555b9e6669d57bd0ae9765792acb1..7613ee54954dd6c6184fda68992a2b5c25a45558 100644 (file)
@@ -883,6 +883,7 @@ static int sha2_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot _sha2_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, sha2_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 38c9bc0405be60726b72101c16cb8d50f566c01b..3ddd0323575b708e327b7381e5d7733e04e0b36c 100644 (file)
@@ -680,6 +680,7 @@ _sha3_exec(PyObject *m)
 }
 
 static PyModuleDef_Slot _sha3_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, _sha3_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 5060e4097d33c910cf00e36cb1e1d43069a13a97..42ec786f953ab6c30ec9b79669eaaaeda0bb68ce 100644 (file)
@@ -1709,6 +1709,7 @@ _signal_module_free(void *module)
 
 
 static PyModuleDef_Slot signal_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, signal_module_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 601638601b0aa5e5660f86004c7a6776a050f870..b26c0bd3af930ff629ecb7eb39deac3cb17ac95a 100644 (file)
@@ -9306,6 +9306,7 @@ error:
 }
 
 static struct PyModuleDef_Slot socket_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, socket_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index a24927a9db64dbd97cf97bda82e41b475ef97682..e9e1c4811b830381743bbe45e377e6ddc460dedb 100644 (file)
@@ -122,6 +122,7 @@ symtable_init_constants(PyObject *m)
 }
 
 static PyModuleDef_Slot symtable_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, symtable_init_constants},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 5d7fd20c4e09992a6982c65140a1cb619093b96e..2d13f9eda758ddcc054982d4012e972cc5f4f417 100644 (file)
@@ -451,6 +451,7 @@ syslog_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot syslog_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, syslog_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index a3260e0f15ab9948b0aca09b29f0a06dca5f97c4..25e744d7da25c72500931c4e90e5e5825207ca72 100644 (file)
@@ -2185,6 +2185,7 @@ time_module_free(void *module)
 
 
 static struct PyModuleDef_Slot time_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, time_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 2c67c23d98ed81a5bd9633fd1f07e546f187b5e0..55b33a76e7af8a339a1ed2f7aa38c3d7fcb49cd9 100644 (file)
@@ -2303,6 +2303,7 @@ unicodedata_exec(PyObject *module)
 }
 
 static PyModuleDef_Slot unicodedata_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, unicodedata_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index e8749331c6a11fdf753d3b021e8a694b2a25753f..aeab78fd77d83be17d7a4d8e9b4f52749daef3c8 100644 (file)
@@ -386,6 +386,7 @@ xx_exec(PyObject *m)
 }
 
 static struct PyModuleDef_Slot xx_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, xx_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index a8a1417f40efefa7f01cf1d8b0217c7d080d7a4a..7a31ba00b981ebf82e640da79a470c0e18299811 100644 (file)
@@ -301,7 +301,10 @@ xxsubtype_exec(PyObject* m)
     return 0;
 }
 
+PyABIInfo_VAR(abi_info);
+
 static struct PyModuleDef_Slot xxsubtype_slots[] = {
+    {Py_mod_abi, &abi_info},
     {Py_mod_exec, xxsubtype_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 7a8ed979bbe65daf23d3dc493dd1af1a7883534f..f67434ecdc908c55d3e469dd054971cf8667f3ab 100644 (file)
@@ -2272,6 +2272,7 @@ zlib_exec(PyObject *mod)
 }
 
 static PyModuleDef_Slot zlib_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_exec, zlib_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
index 954efcc19cebd945818b61b5daab6affb84953da..4bf4479065e3327717cfae49668e2fd9c70ed711 100644 (file)
@@ -14928,6 +14928,7 @@ static PyMethodDef _string_methods[] = {
 };
 
 static PyModuleDef_Slot module_slots[] = {
+    _Py_ABI_SLOT,
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
     {0, NULL}
index 5ad20d49fa4b3100d954b72deee445c01c8d9ced..71a164fbec5a06785ecd3f8e91f6a6fc2435a81f 100755 (executable)
@@ -1989,6 +1989,7 @@ class ASTModuleVisitor(PickleVisitor):
         self.emit("", 0)
         self.emit("""
 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},
index 5d319992dcda1e9fca5ac6b9da421c16fcc47d5f..dad1530e343a38a3e0e8326b6ecf504812ea0334 100644 (file)
@@ -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},
index c50ff1190686c295382b2f4c1b7b68916606c29d..e6d39e4c7dc8235b027e2569304d526c1356387b 100644 (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},
index 0f8b8004c1af22e1b43a60021a51ca4ab6f09106..86acc94fbc79cdcd6500ffc337e32048ca86291d 100644 (file)
@@ -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},
index 6b6ac238935765f943c6e21e77abb8e4be742e90..6b8fa19ff3f606b667171c21c1f5f659a65fb62d 100644 (file)
@@ -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},
index 34224f4c6d6514afc1d0c101bc863fba40db822c..f615fe37ba8fbee6d8bb11fb100f4b732c5ff8be 100644 (file)
@@ -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},
index cc6a787ba75022b19a37d30f4f69226fa74d4660..b60a36e128cd9fe8cdab3b50d5a1c6c712cc12de 100644 (file)
@@ -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},