File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1253,17 +1253,16 @@ finalize_interp_clear(PyThreadState *tstate)
12531253{
12541254 int is_main_interp = _Py_IsMainInterpreter (tstate );
12551255
1256- /* bpo-36854: Explicitly clear the codec registry
1257- and trigger a GC collection */
12581256 PyInterpreterState * interp = tstate -> interp ;
1259- Py_CLEAR (interp -> codec_search_path );
1260- Py_CLEAR (interp -> codec_search_cache );
1261- Py_CLEAR (interp -> codec_error_registry );
1262- _PyGC_CollectNoFail ();
12631257
12641258 /* Clear interpreter state and all thread states */
12651259 PyInterpreterState_Clear (tstate -> interp );
12661260
1261+ /* Trigger a GC collection on subinterpreters*/
1262+ if (!is_main_interp ) {
1263+ _PyGC_CollectNoFail ();
1264+ }
1265+
12671266 finalize_interp_types (tstate , is_main_interp );
12681267
12691268 if (is_main_interp ) {
You can’t perform that action at this time.
0 commit comments