File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -768,6 +768,14 @@ def _get_running_loop():
768768    This is a low-level function intended to be used by event loops. 
769769    This function is thread-specific. 
770770    """ 
771+     # Prefer C implementation if available 
772+     try :
773+         if  _c__get_running_loop  is  not   _py__get_running_loop :
774+             return  _c__get_running_loop ()
775+     except  NameError :
776+         # C implementation not available 
777+         pass 
778+     
771779    # NOTE: this function is implemented in C (see _asynciomodule.c) 
772780    running_loop , pid  =  _running_loop .loop_pid 
773781    if  running_loop  is  not   None  and  pid  ==  os .getpid ():
@@ -782,6 +790,14 @@ def _set_running_loop(loop):
782790    """ 
783791    # NOTE: this function is implemented in C (see _asynciomodule.c) 
784792    _running_loop .loop_pid  =  (loop , os .getpid ())
793+     
794+     # Keep C implementation in sync if available   
795+     try :
796+         if  _c__set_running_loop  is  not   _py__set_running_loop :
797+             _c__set_running_loop (loop )
798+     except  NameError :
799+         # C implementation not available 
800+         pass 
785801
786802
787803def  _init_event_loop_policy ():
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments