bpo-43268: _Py_IsMainInterpreter() now expects interp (GH-24577)

The _Py_IsMainInterpreter() function now expects interp rather than
tstate.
This commit is contained in:
Victor Stinner 2021-02-19 13:33:31 +01:00 committed by GitHub
parent 62078101ea
commit 101bf69ff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 15 deletions

View file

@ -5719,7 +5719,7 @@ _PyLong_Init(PyThreadState *tstate)
tstate->interp->small_ints[i] = v;
}
if (_Py_IsMainInterpreter(tstate)) {
if (_Py_IsMainInterpreter(tstate->interp)) {
/* initialize int_info */
if (Int_InfoType.tp_name == NULL) {
if (PyStructSequence_InitType2(&Int_InfoType, &int_info_desc) < 0) {

View file

@ -286,7 +286,7 @@ void
_PyType_Fini(PyThreadState *tstate)
{
_PyType_ClearCache(&tstate->interp->type_cache);
if (_Py_IsMainInterpreter(tstate)) {
if (_Py_IsMainInterpreter(tstate->interp)) {
clear_slotdefs();
}
}

View file

@ -15701,7 +15701,7 @@ _PyUnicode_Init(PyThreadState *tstate)
return _PyStatus_NO_MEMORY();
}
if (_Py_IsMainInterpreter(tstate)) {
if (_Py_IsMainInterpreter(tstate->interp)) {
/* initialize the linebreak bloom filter */
bloom_linebreak = make_bloom_mask(
PyUnicode_2BYTE_KIND, linebreak,