summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-03 16:53:51 (GMT)
committerGitHub <noreply@github.com>2023-10-03 16:53:51 (GMT)
commitd73501602f863a54c872ce103cd3fa119e38bac9 (patch)
treedf6d23aa36d385215bb03f22fe0aacf625bbdf1e /Modules/_testcapimodule.c
parent6ab6040054e5ca2d3eb7833dc8bf4eb0bbaa0aac (diff)
downloadcpython-d73501602f863a54c872ce103cd3fa119e38bac9.zip
cpython-d73501602f863a54c872ce103cd3fa119e38bac9.tar.gz
cpython-d73501602f863a54c872ce103cd3fa119e38bac9.tar.bz2
gh-108867: Add PyThreadState_GetUnchecked() function (#108870)
Add PyThreadState_GetUnchecked() function: similar to PyThreadState_Get(), but don't issue a fatal error if it is NULL. The caller is responsible to check if the result is NULL. Previously, this function was private and known as _PyThreadState_UncheckedGet().
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 64bcb49..a46d986 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -2458,8 +2458,8 @@ test_tstate_capi(PyObject *self, PyObject *Py_UNUSED(args))
PyThreadState *tstate2 = PyThreadState_Get();
assert(tstate2 == tstate);
- // private _PyThreadState_UncheckedGet()
- PyThreadState *tstate3 = _PyThreadState_UncheckedGet();
+ // PyThreadState_GetUnchecked()
+ PyThreadState *tstate3 = PyThreadState_GetUnchecked();
assert(tstate3 == tstate);
// PyThreadState_EnterTracing(), PyThreadState_LeaveTracing()