Skip to content

Commit 1b23d9f

Browse files
committed
Define _Py_ABI_SLOT using _PyABIInfo_DEFAULT
_PyABIInfo_DEFAULT is available in Include/modsupport.h, there's not need to duplicate the definition here. Rename from _Py_INTERNAL_ABI_SLOT, as it's no longer internal.
1 parent 467507a commit 1b23d9f

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

Include/cpython/modsupport.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,8 @@ typedef struct _PyArg_Parser {
3838
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
3939
struct _PyArg_Parser *, ...);
4040

41-
#ifdef Py_BUILD_CORE
42-
// Internal; defined here to avoid explicitly including pycore_modsupport.h
43-
#define _Py_INTERNAL_ABI_SLOT \
44-
{Py_mod_abi, (void*) &(PyABIInfo) { \
45-
.abiinfo_major_version = 1, \
46-
.abiinfo_minor_version = 0, \
47-
.flags = PyABIInfo_INTERNAL, \
48-
.build_version = PY_VERSION_HEX, \
49-
.abi_version = PY_VERSION_HEX }} \
41+
// For internal use in stdlib. Needs C99 compound literals.
42+
// Defined here to avoid every stdlib module including pycore_modsupport.h
43+
#define _Py_ABI_SLOT \
44+
{Py_mod_abi, (void*) &(PyABIInfo) _PyABIInfo_DEFAULT} \
5045
///////////////////////////////////////////////////////
51-
#endif

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7656,7 +7656,7 @@ _datetime_exec(PyObject *module)
76567656
}
76577657

76587658
static PyModuleDef_Slot module_slots[] = {
7659-
_Py_INTERNAL_ABI_SLOT,
7659+
_Py_ABI_SLOT,
76607660
{Py_mod_exec, _datetime_exec},
76617661
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
76627662
{Py_mod_gil, Py_MOD_GIL_NOT_USED},

0 commit comments

Comments
 (0)