File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2619,7 +2619,9 @@ _PyXI_Enter(_PyXI_session *session,
26192619            PyInterpreterState  * interp , PyObject  * nsupdates ,
26202620            _PyXI_session_result  * result )
26212621{
2622-     PyThreadState  * tstate  =  _PyThreadState_GET ();
2622+ #ifndef  NDEBUG 
2623+     PyThreadState  * tstate  =  _PyThreadState_GET ();  // Only used for asserts 
2624+ #endif 
26232625
26242626    // Convert the attrs for cross-interpreter use. 
26252627    _PyXI_namespace  * sharedns  =  NULL ;
@@ -2661,7 +2663,9 @@ _PyXI_Enter(_PyXI_session *session,
26612663    _enter_session (session , interp );
26622664    _PyXI_failure  override  =  XI_FAILURE_INIT ;
26632665    override .code  =  _PyXI_ERR_UNCAUGHT_EXCEPTION ;
2666+ #ifndef  NDEBUG 
26642667    tstate  =  _PyThreadState_GET ();
2668+ #endif 
26652669
26662670    // Ensure this thread owns __main__. 
26672671    if  (_PyInterpreterState_SetRunningMain (interp ) <  0 ) {
@@ -2697,7 +2701,9 @@ _PyXI_Enter(_PyXI_session *session,
26972701
26982702    // Exit the session. 
26992703    _exit_session (session );
2704+ #ifndef  NDEBUG 
27002705    tstate  =  _PyThreadState_GET ();
2706+ #endif 
27012707
27022708    if  (sharedns  !=  NULL ) {
27032709        _destroy_sharedns (sharedns );
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments