summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-26 21:32:00 (GMT)
committerGitHub <noreply@github.com>2024-06-26 21:32:00 (GMT)
commitc052b192aaa05eeedb1bd50e0658e2d836ffa581 (patch)
treee1be65bbf070f16e1299c6542588ff78984fd484 /Python/import.c
parentbc515b332bef0eaa3064d3b912ad660932ad8c90 (diff)
downloadcpython-c052b192aaa05eeedb1bd50e0658e2d836ffa581.zip
cpython-c052b192aaa05eeedb1bd50e0658e2d836ffa581.tar.gz
cpython-c052b192aaa05eeedb1bd50e0658e2d836ffa581.tar.bz2
[3.13] gh-120838: Add _PyThreadState_WHENCE_FINI (gh-121013)
We also add _PyThreadState_NewBound() and drop _PyThreadState_SetWhence(). This change only affects internal API. (cherry picked from commit a905721b9c5c15279e67c2f7785034b7356b2d46, AKA gh-121010) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
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 dc7ff90..98ecaed 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);