Skip to content

Commit bb90751

Browse files
committed
Rename PyInterpreterState_GetIDFromThreadState
1 parent cbe0c15 commit bb90751

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

graalpython/com.oracle.graal.python.cext/include/pystate.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -39,8 +39,10 @@ PyAPI_FUNC(PyObject *) PyInterpreterState_GetDict(PyInterpreterState *);
3939
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
4040
/* New in 3.7 */
4141
PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *);
42-
// GraalPy-specific
43-
PyAPI_FUNC(int64_t) PyInterpreterState_GetIDFromThreadState(PyThreadState *);
42+
// GraalPy public API
43+
PyAPI_FUNC(int64_t) GraalPyInterpreterState_GetIDFromThreadState(PyThreadState *);
44+
// Deprecated alias used by current Cython, remove in 27.0
45+
#define PyInterpreterState_GetIDFromThreadState GraalPyInterpreterState_GetIDFromThreadState
4446
#endif
4547
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
4648

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,7 @@ _PyThreadState_MustExit(PyThreadState *tstate)
32123212

32133213
// GraalPy specific
32143214

3215-
int64_t PyInterpreterState_GetIDFromThreadState(PyThreadState *state) {
3215+
int64_t GraalPyInterpreterState_GetIDFromThreadState(PyThreadState *state) {
32163216
return 0;
32173217
}
32183218

graalpython/com.oracle.graal.python.processor/src/com/oracle/graal/python/processor/CApiBuiltinsProcessor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ private static Path resolvePath(Path path) {
750750
* removing
751751
*/
752752
"PySlice_Start", "PySlice_Step", "PySlice_Stop",
753-
"PyInterpreterState_GetIDFromThreadState",
754753
"PyObject_GetDoc", "PyObject_SetDoc", "_PyFrame_SetLineNumber",
755754
"PyCode_GetName",
756755
"PyCode_GetFileName", "_PyArray_Resize", "_PyArray_Data",

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CApiFunction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ public final class CApiFunction {
317317
@CApiBuiltin(name = "PyInstanceMethod_Function", ret = PyObject, args = {PyObject}, call = CImpl)
318318
@CApiBuiltin(name = "PyInterpreterState_GetDict", ret = PyObject, args = {PyInterpreterState}, call = CImpl)
319319
@CApiBuiltin(name = "PyInterpreterState_GetID", ret = INT64_T, args = {PyInterpreterState}, call = CImpl)
320-
@CApiBuiltin(name = "PyInterpreterState_GetIDFromThreadState", ret = INT64_T, args = {PyThreadState}, call = CImpl)
321320
@CApiBuiltin(name = "PyInterpreterState_Main", ret = PyInterpreterState, args = {}, call = CImpl)
322321
@CApiBuiltin(name = "PyIter_Send", ret = PySendResult, args = {PyObject, PyObject, PyObjectPtr}, call = CImpl)
323322
@CApiBuiltin(name = "PyList_SetItem", ret = Int, args = {PyObject, Py_ssize_t, PyObjectTransfer}, call = CImpl)

graalpython/lib-graalpython/patches/Cython-0.29.32.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ index f8bf885..94d0ca6 100644
270270
#if PY_VERSION_HEX >= 0x030700A1
271271
static PY_INT64_T main_interpreter_id = -1;
272272
- PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
273-
+ PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
273+
+ PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
274274
if (main_interpreter_id == -1) {
275275
main_interpreter_id = current_id;
276276
return (unlikely(current_id == -1)) ? -1 : 0;

graalpython/lib-graalpython/patches/Cython-0.29.37.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ index cfff606..90876c6 100644
324324
#if PY_VERSION_HEX >= 0x030700A1
325325
static PY_INT64_T main_interpreter_id = -1;
326326
- PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
327-
+ PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
327+
+ PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
328328
if (main_interpreter_id == -1) {
329329
main_interpreter_id = current_id;
330330
return (unlikely(current_id == -1)) ? -1 : 0;

graalpython/lib-graalpython/patches/Cython-3.0.10.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ index d8f60a4..cd61759 100644
261261
#if PY_VERSION_HEX >= 0x030700A1
262262
static PY_INT64_T main_interpreter_id = -1;
263263
- PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
264-
+ PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
264+
+ PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
265265
if (main_interpreter_id == -1) {
266266
main_interpreter_id = current_id;
267267
return (unlikely(current_id == -1)) ? -1 : 0;

graalpython/lib-graalpython/patches/catboost-1.2.2.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ index 85036794..11c9ce42 100644
398398
#if PY_VERSION_HEX >= 0x030700A1
399399
static PY_INT64_T main_interpreter_id = -1;
400400
- PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
401-
+ PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
401+
+ PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
402402
if (main_interpreter_id == -1) {
403403
main_interpreter_id = current_id;
404404
return (unlikely(current_id == -1)) ? -1 : 0;

graalpython/lib-graalpython/patches/catboost-1.2.3.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ index 85036794..11c9ce42 100644
398398
#if PY_VERSION_HEX >= 0x030700A1
399399
static PY_INT64_T main_interpreter_id = -1;
400400
- PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
401-
+ PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
401+
+ PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
402402
if (main_interpreter_id == -1) {
403403
main_interpreter_id = current_id;
404404
return (unlikely(current_id == -1)) ? -1 : 0;

0 commit comments

Comments
 (0)