Skip to content

Commit 6207810

Browse files
authored
bpo-40522: Replace PyThreadState_GET() with PyThreadState_Get() (GH-24575)
Use directly the PyThreadState_Get() function in public header files, since PyThreadState_GET() macro is just an alias to it in pratice in these files.
1 parent 5592f2b commit 6207810

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Include/cpython/abstract.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static inline PyObject *
119119
PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120120
size_t nargsf, PyObject *kwnames)
121121
{
122-
PyThreadState *tstate = PyThreadState_GET();
122+
PyThreadState *tstate = PyThreadState_Get();
123123
return _PyObject_VectorcallTstate(tstate, callable,
124124
args, nargsf, kwnames);
125125
}
@@ -155,7 +155,7 @@ _PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const
155155
static inline PyObject *
156156
_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157157
{
158-
PyThreadState *tstate = PyThreadState_GET();
158+
PyThreadState *tstate = PyThreadState_Get();
159159
return _PyObject_FastCallTstate(tstate, func, args, nargs);
160160
}
161161

@@ -164,7 +164,7 @@ _PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
164164
PyObject_CallNoArgs(). */
165165
static inline PyObject *
166166
_PyObject_CallNoArg(PyObject *func) {
167-
PyThreadState *tstate = PyThreadState_GET();
167+
PyThreadState *tstate = PyThreadState_Get();
168168
return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL);
169169
}
170170

@@ -179,7 +179,7 @@ PyObject_CallOneArg(PyObject *func, PyObject *arg)
179179
assert(arg != NULL);
180180
args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181181
args[0] = arg;
182-
tstate = PyThreadState_GET();
182+
tstate = PyThreadState_Get();
183183
nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
184184
return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL);
185185
}

Include/cpython/object.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ PyAPI_FUNC(int) _PyTrash_cond(PyObject *op, destructor dealloc);
528528
/* If "cond" is false, then _tstate remains NULL and the deallocator \
529529
* is run normally without involving the trashcan */ \
530530
if (cond) { \
531-
_tstate = PyThreadState_GET(); \
531+
_tstate = PyThreadState_Get(); \
532532
if (_PyTrash_begin(_tstate, _PyObject_CAST(op))) { \
533533
break; \
534534
} \

0 commit comments

Comments
 (0)