aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/import.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2024-06-25 14:35:12 -0600
committerGitHub <noreply@github.com>2024-06-25 14:35:12 -0600
commita905721b9c5c15279e67c2f7785034b7356b2d46 (patch)
tree128afaafee27cac1e55fe22e552a2e41ac8921ef /Python/import.c
parent769aea332940f03c3e5b1ad9badd6635c1ac992a (diff)
downloadcpython-a905721b9c5c15279e67c2f7785034b7356b2d46.tar.gz
cpython-a905721b9c5c15279e67c2f7785034b7356b2d46.zip
gh-120838: Add _PyThreadState_WHENCE_FINI (gh-121010)
We also add _PyThreadState_NewBound() and drop _PyThreadState_SetWhence(). This change only affects internal API.
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);