Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-40522: Replace PyThreadState_GET() with PyThreadState_Get() #24575

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Include/cpython/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static inline PyObject *
PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
size_t nargsf, PyObject *kwnames)
{
PyThreadState *tstate = PyThreadState_GET();
PyThreadState *tstate = PyThreadState_Get();
return _PyObject_VectorcallTstate(tstate, callable,
args, nargsf, kwnames);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ _PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const
static inline PyObject *
_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
{
PyThreadState *tstate = PyThreadState_GET();
PyThreadState *tstate = PyThreadState_Get();
return _PyObject_FastCallTstate(tstate, func, args, nargs);
}

Expand All @@ -164,7 +164,7 @@ _PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
PyObject_CallNoArgs(). */
static inline PyObject *
_PyObject_CallNoArg(PyObject *func) {
PyThreadState *tstate = PyThreadState_GET();
PyThreadState *tstate = PyThreadState_Get();
return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL);
}

Expand All @@ -179,7 +179,7 @@ PyObject_CallOneArg(PyObject *func, PyObject *arg)
assert(arg != NULL);
args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
args[0] = arg;
tstate = PyThreadState_GET();
tstate = PyThreadState_Get();
nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion Include/cpython/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ PyAPI_FUNC(int) _PyTrash_cond(PyObject *op, destructor dealloc);
/* If "cond" is false, then _tstate remains NULL and the deallocator \
* is run normally without involving the trashcan */ \
if (cond) { \
_tstate = PyThreadState_GET(); \
_tstate = PyThreadState_Get(); \
if (_PyTrash_begin(_tstate, _PyObject_CAST(op))) { \
break; \
} \
Expand Down