File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -367,6 +367,7 @@ def __init__(self, tkconsole):
367367 self .port = PORT
368368 self .original_compiler_flags = self .compile .compiler .flags
369369
370+ _afterid = None
370371 rpcclt = None
371372 rpcsubproc = None
372373
@@ -486,6 +487,8 @@ def interrupt_subprocess(self):
486487 threading .Thread (target = self .__request_interrupt ).start ()
487488
488489 def kill_subprocess (self ):
490+ if self ._afterid is not None :
491+ self .tkconsole .text .after_cancel (self ._afterid )
489492 try :
490493 self .rpcclt .listening_sock .close ()
491494 except AttributeError : # no socket
@@ -561,8 +564,8 @@ def poll_subprocess(self):
561564 pass
562565 # Reschedule myself
563566 if not self .tkconsole .closing :
564- self .tkconsole .text .after (self . tkconsole . pollinterval ,
565- self .poll_subprocess )
567+ self ._afterid = self . tkconsole .text .after (
568+ self . tkconsole . pollinterval , self .poll_subprocess )
566569
567570 debugger = None
568571
@@ -973,10 +976,6 @@ def close(self):
973976 self .stop_readline ()
974977 self .canceled = True
975978 self .closing = True
976- # Wait for poll_subprocess() rescheduling to stop
977- self .text .after (2 * self .pollinterval , self .close2 )
978-
979- def close2 (self ):
980979 return EditorWindow .close (self )
981980
982981 def _close (self ):
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ Library
8181IDLE
8282----
8383
84+ - Issue #5492: Avoid traceback when exiting IDLE caused by a race condition.
85+
8486- Issue #17511: Keep IDLE find dialog open after clicking "Find Next".
8587 Original patch by Sarah K.
8688
You can’t perform that action at this time.
0 commit comments