Skip to content

Commit 96a8693

Browse files
gouzilSigureMo
authored andcommitted
[SOT][3.14] Update the internal function to use PyObject_GC_Track replace _PyObject_GC_TRACK (PaddlePaddle#78558)
--------- Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
1 parent 368cbed commit 96a8693

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ci/run_sot_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function run_sot_test() {
4848
run_and_check "Uninstalling numpy for Python 3.14..." \
4949
$PYTHON_WITH_SPECIFY_VERSION -m pip uninstall -y "numpy"
5050
run_and_check "Installing numpy>=2.3.5 for Python 3.14..." \
51-
$PYTHON_WITH_SPECIFY_VERSION -m pip install "numpy>=2.3.5"
51+
$PYTHON_WITH_SPECIFY_VERSION -m pip install --force-reinstall --no-cache-dir "numpy>=2.3.5"
5252
fi
5353

5454
# cd to sot test dir

paddle/fluid/pybind/sot/cpython_internals/internals_3_14.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ limitations under the License. */
1818

1919
#include <internal/pycore_code.h>
2020
#include <internal/pycore_frame.h>
21+
#include <internal/pycore_genobject.h>
2122
#define Py_BUILD_CORE // internal/pycore_opcode.h need this macro
2223
#define NEED_OPCODE_TABLES // To get _PyOpcode_Caches and _PyOpcode_Deopt
2324

@@ -141,7 +142,7 @@ static void Internal_take_ownership(PyFrameObject *f,
141142
PyErr_SetRaisedException(exc);
142143
}
143144
if (!_PyObject_GC_IS_TRACKED((PyObject *)f)) {
144-
_PyObject_GC_TRACK((PyObject *)f);
145+
PyObject_GC_Track((PyObject *)f);
145146
}
146147
Py_END_CRITICAL_SECTION();
147148
}

0 commit comments

Comments
 (0)