aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index 366c0167d03..20ad1002004 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1518,11 +1518,11 @@ switch_to_main_interpreter(PyThreadState *tstate)
if (_Py_IsMainInterpreter(tstate->interp)) {
return tstate;
}
- PyThreadState *main_tstate = PyThreadState_New(_PyInterpreterState_Main());
+ PyThreadState *main_tstate = _PyThreadState_NewBound(
+ _PyInterpreterState_Main(), _PyThreadState_WHENCE_EXEC);
if (main_tstate == NULL) {
return NULL;
}
- main_tstate->_whence = _PyThreadState_WHENCE_EXEC;
#ifndef NDEBUG
PyThreadState *old_tstate = PyThreadState_Swap(main_tstate);
assert(old_tstate == tstate);