We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0560cac commit 0f0c305Copy full SHA for 0f0c305
Python/import.c
@@ -1159,7 +1159,10 @@ static PyThreadState *
1159
maybe_switch_to_main_interpreter(PyThreadState *tstate)
1160
{
1161
PyThreadState *main_tstate = tstate;
1162
- if (check_multi_interp_extensions(tstate->interp)) {
+ if (_Py_IsMainInterpreter(tstate->interp)) {
1163
+ /* There's no need to switch. */
1164
+ }
1165
+ else if (check_multi_interp_extensions(tstate->interp)) {
1166
/*
1167
If the module is single-phase init then the import will fail.
1168
However, the module's init function will still get run.
0 commit comments