Skip to content

Commit 7115c75

Browse files
cleanup 1
1 parent 04318d0 commit 7115c75

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Include/internal/pycore_pystate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static inline PyInterpreterState* _PyInterpreterState_GET(void) {
212212
#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE)
213213
return _Py_tss_interp;
214214
#else
215-
return PyInterpreterState_Get();
215+
return _PyThreadState_GET()->interp;
216216
#endif
217217
}
218218

Python/pystate.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,9 +1287,8 @@ _PyInterpreterState_RequireIDRef(PyInterpreterState *interp, int required)
12871287
PyInterpreterState*
12881288
PyInterpreterState_Get(void)
12891289
{
1290-
PyThreadState *tstate = current_fast_get();
1291-
_Py_EnsureTstateNotNULL(tstate);
1292-
PyInterpreterState *interp = tstate->interp;
1290+
_Py_AssertHoldsTstate();
1291+
PyInterpreterState *interp = _Py_tss_interp;
12931292
if (interp == NULL) {
12941293
Py_FatalError("no current interpreter");
12951294
}

0 commit comments

Comments
 (0)