File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed 
prompt_toolkit/application Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,7 @@ def _update_invalidate_events(self):
458458 # Remove all the original event handlers. (Components can be removed 
459459 # from the UI.) 
460460 for  ev  in  self ._invalidate_events :
461-  ev  -=  self .invalidate 
461+  ev  -=  self ._invalidate_handler 
462462
463463 # Gather all new events. 
464464 # (All controls are able to invalidate themselves.) 
@@ -469,12 +469,14 @@ def gather_events():
469469
470470 self ._invalidate_events  =  list (gather_events ())
471471
472-  # Attach invalidate event handler. 
473-  def  invalidate (sender ):
474-  self .invalidate ()
475- 
476472 for  ev  in  self ._invalidate_events :
477-  ev  +=  invalidate 
473+  ev  +=  self ._invalidate_handler 
474+ 
475+  def  _invalidate_handler (self , sender ):
476+  """ 
477+  Handler to allow invalidate to be called with the correct signature. 
478+  """ 
479+  self .invalidate ()
478480
479481 def  _on_resize (self ):
480482 """ 
@@ -623,7 +625,7 @@ def flush_input():
623625 # invalidate should not trigger a repaint in 
624626 # terminated applications.) 
625627 for  ev  in  self ._invalidate_events :
626-  ev  -=  self .invalidate 
628+  ev  -=  self ._invalidate_handler 
627629 self ._invalidate_events  =  []
628630
629631 # Wait for CPR responses. 
                         You can’t perform that action at this time. 
           
                  
0 commit comments