File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ def install_repl_displayhook():
122122    Install a repl display hook so that any stale figure are automatically 
123123    redrawn when control is returned to the repl. 
124124
125-     This works with both IPython terminals and vanilla python shells. 
125+     This works with IPython terminals and kernels, 
126+     as well as vanilla python shells. 
126127    """ 
127128    global  _IP_REGISTERED 
128129    global  _INSTALL_FIG_OBSERVER 
@@ -155,6 +156,13 @@ def post_execute():
155156
156157            _IP_REGISTERED  =  post_execute 
157158            _INSTALL_FIG_OBSERVER  =  False 
159+ 
160+             # trigger IPython's eventloop integration, if available 
161+             from  IPython .core .pylabtools  import  backend2gui 
162+ 
163+             ipython_gui_name  =  backend2gui .get (get_backend ())
164+             if  ipython_gui_name :
165+                 ip .enable_gui (ipython_gui_name )
158166        else :
159167            _INSTALL_FIG_OBSERVER  =  True 
160168
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments