summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/pystate.h2
-rw-r--r--Include/internal/pycore_pystate.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 7052228804..9b28f66fdb 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -165,7 +165,7 @@ PyAPI_FUNC(int) PyGILState_Check(void);
This function doesn't check for error. Return NULL before _PyGILState_Init()
is called and after _PyGILState_Fini() is called.
- See also _PyInterpreterState_Get() and _PyInterpreterState_GET_UNSAFE(). */
+ See also _PyInterpreterState_Get() and _PyInterpreterState_GET(). */
PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void);
/* The implementation of sys._current_frames() Returns a dict mapping
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 2e783781ad..c82e8db905 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -78,8 +78,9 @@ static inline PyThreadState *_PyThreadState_GET(void) {
See also _PyInterpreterState_Get()
and _PyGILState_GetInterpreterStateUnsafe(). */
-static inline PyInterpreterState* _PyInterpreterState_GET_UNSAFE(void) {
+static inline PyInterpreterState* _PyInterpreterState_GET(void) {
PyThreadState *tstate = _PyThreadState_GET();
+ assert(tstate != NULL);
return tstate->interp;
}