@@ -1161,11 +1161,11 @@ maybe_switch_to_main_interpreter(PyThreadState *tstate)
1161
1161
PyThreadState * main_tstate = tstate ;
1162
1162
if (check_multi_interp_extensions (tstate -> interp )) {
1163
1163
/*
1164
- If the module is single-phase init then the import
1165
- will fail. However, the module's init function will still
1166
- get run. That means it may still store state in the
1167
- shared-object/DLL address space (which never gets
1168
- closed/cleared), including objects (e.g. static types).
1164
+ If the module is single-phase init then the import will fail.
1165
+ However, the module's init function will still get run.
1166
+ That means it may still store state in the shared-object/DLL
1167
+ address space (which never gets closed/cleared), including
1168
+ objects (e.g. static types).
1169
1169
1170
1170
This is a problem for isolated subinterpreters since each
1171
1171
has its own object allocator. If the loaded shared-object
@@ -1174,13 +1174,14 @@ maybe_switch_to_main_interpreter(PyThreadState *tstate)
1174
1174
or else any later use of that object by another interpreter
1175
1175
(or across multiple init-fini cycles) will crash the process.
1176
1176
1177
- We avoid the problem by first loading the module in the main
1178
- interpreter.
1177
+ We avoid the problem by first loading the module
1178
+ in the main interpreter.
1179
1179
1180
- Here's another complication: the module's init function might
1181
- register callbacks, whether in Python (e.g. sys.stdin, atexit)
1182
- or in linked libraries. Thus we cannot just dlclose() the
1183
- module in this error case.
1180
+ Here's another complication we avoid: the module's init
1181
+ function might register callbacks, whether in Python
1182
+ (e.g. sys.stdin, atexit) or in linked libraries.
1183
+ Thus we cannot just dlclose() the module
1184
+ in this error case.
1184
1185
*/
1185
1186
main_tstate = PyThreadState_New (_PyInterpreterState_Main ());
1186
1187
if (main_tstate == NULL ) {
0 commit comments