Skip to content

Commit cb84c1d

Browse files
Treat the main interpreter specially in resolve_interp().
1 parent bfaea54 commit cb84c1d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Modules/_interpretersmodule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,11 @@ resolve_interp(PyObject *idobj, int restricted, int reqready, const char *op)
755755
}
756756
}
757757

758+
if (_Py_IsMainInterpreter(interp)) {
759+
assert(_PyInterpreterState_IsReady(interp));
760+
return interp;
761+
}
762+
758763
if (reqready && !_PyInterpreterState_IsReady(interp)) {
759764
if (idobj == NULL) {
760765
PyErr_Format(PyExc_InterpreterError,

0 commit comments

Comments
 (0)