Skip to content

Commit c015606

Browse files
committed
Add _Py_INTERNAL_ABI_SLOT (to _datetime for now)
1 parent 3b6aa96 commit c015606

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Include/cpython/modsupport.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ typedef struct _PyArg_Parser {
2424

2525
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
2626
struct _PyArg_Parser *, ...);
27+
28+
#ifdef Py_BUILD_CORE
29+
// Internal; defined here to avoid explicitly including pycore_modsupport.h
30+
#define _Py_INTERNAL_ABI_SLOT \
31+
{Py_mod_abi, (void*) &(PyABIInfo) { \
32+
.abiinfo_major_version = 1, \
33+
.abiinfo_minor_version = 0, \
34+
.flags = PyABIInfo_INTERNAL, \
35+
.build_version = PY_VERSION_HEX, \
36+
.abi_version = PY_VERSION_HEX }} \
37+
///////////////////////////////////////////////////////
38+
#endif

Modules/_datetimemodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7495,6 +7495,7 @@ _datetime_exec(PyObject *module)
74957495
}
74967496

74977497
static PyModuleDef_Slot module_slots[] = {
7498+
_Py_INTERNAL_ABI_SLOT,
74987499
{Py_mod_exec, _datetime_exec},
74997500
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
75007501
{Py_mod_gil, Py_MOD_GIL_NOT_USED},

0 commit comments

Comments
 (0)