Skip to content

Commit 8889060

Browse files
abdelbernielkorchi
authored andcommitted
[GR-65335] Backport to 24.2: Revert breaking ABI in graalpy242 wheels.
PullRequest: graalpython/3816
2 parents 76d4966 + 38135d2 commit 8889060

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

graalpython/com.oracle.graal.python.cext/include/cpython/tupleobject.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ PyAPI_FUNC(PyObject **) PyTruffleTuple_GetItems(PyObject *op);
4141

4242
// GraalPy change: Export PyTuple_SET_ITEM as regular API function to use in PyO3 and others
4343
PyAPI_FUNC(void) PyTuple_SET_ITEM(PyObject*, Py_ssize_t, PyObject*);
44+
45+
/* Inline function to be used in the PyTuple_SET_ITEM macro. */
46+
static inline void graalpy_tuple_set_item(PyObject *op, Py_ssize_t index, PyObject *value) {
47+
PyTruffleTuple_GetItems(op)[index] = value;
48+
}
4449
#define PyTuple_SET_ITEM(op, index, value) \
45-
PyTuple_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value))
50+
graalpy_tuple_set_item(_PyObject_CAST(op), (index), _PyObject_CAST(value))
4651

4752
PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);

graalpython/com.oracle.graal.python.cext/src/tupleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,5 +1428,5 @@ _PyTuple_GET_ITEM(PyObject* a, Py_ssize_t b) {
14281428
#undef PyTuple_SET_ITEM
14291429
// Export PyTuple_SET_ITEM as regular API function to use in PyO3 and others
14301430
void PyTuple_SET_ITEM(PyObject* op, Py_ssize_t index, PyObject* value) {
1431-
PyTruffleTuple_GetItems(op)[index] = value;
1431+
graalpy_tuple_set_item(op, index, value);
14321432
}

0 commit comments

Comments
 (0)