Revert "gh-128639: Don't assume one thread in subinterpreter finalization (gh-128640)" (gh-134256)

This reverts commit 9859791f9e.

The original change broke the iOS and android buildbots, where the tests are run single-process.
This commit is contained in:
Peter Bierma 2025-05-19 14:22:05 -04:00 committed by GitHub
parent 871d269875
commit 27bd08273c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 99 deletions

View file

@ -1395,12 +1395,9 @@ static int test_audit_subinterpreter(void)
PySys_AddAuditHook(_audit_subinterpreter_hook, NULL);
_testembed_initialize();
PyThreadState *tstate = PyThreadState_Get();
for (int i = 0; i < 3; ++i)
{
Py_EndInterpreter(Py_NewInterpreter());
PyThreadState_Swap(tstate);
}
Py_NewInterpreter();
Py_NewInterpreter();
Py_NewInterpreter();
Py_Finalize();