File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2128,9 +2128,6 @@ _Py_Finalize(_PyRuntimeState *runtime)
21282128    // Block some operations. 
21292129    tstate -> interp -> finalizing  =  1 ;
21302130
2131-     // This call stops the world and takes the pending calls lock. 
2132-     make_pre_finalization_calls (tstate );
2133- 
21342131    /* Clean up any lingering subinterpreters. 
21352132
21362133       Two preconditions need to be met here: 
@@ -2139,8 +2136,12 @@ _Py_Finalize(_PyRuntimeState *runtime)
21392136          called, or else threads might get prematurely blocked. 
21402137        - The world must not be stopped, as finalizers can run. 
21412138    */ 
2139+     // TODO: Prevent new subinterpreters after this point 
21422140    finalize_subinterpreters ();
21432141
2142+     // This call stops the world and takes the pending calls lock. 
2143+     make_pre_finalization_calls (tstate );
2144+ 
21442145    assert (_PyThreadState_GET () ==  tstate );
21452146
21462147    /* Copy the core config, PyInterpreterState_Delete() free 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments