]> granicus.if.org Git - python/commitdiff
bpo-36152: IDLE: Remove unused parameter from colorizer (GH-12109)
authorCheryl Sabella <cheryl.sabella@gmail.com>
Fri, 1 Mar 2019 10:19:40 +0000 (05:19 -0500)
committerGitHub <noreply@github.com>
Fri, 1 Mar 2019 10:19:40 +0000 (05:19 -0500)
Remove colorizer.ColorDelegator.close_when_done and the corresponding argument of .close().  In IDLE, both have always been None or False since 2007.

Lib/idlelib/colorizer.py
Lib/idlelib/editor.py
Misc/NEWS.d/next/IDLE/2019-02-28-18-52-40.bpo-36152.9pkHIU.rst [new file with mode: 0644]

index fd13281fb29500d7a8574865cf9e2ae1a4c0dbfc..facbef8bb189191cc36d9e9300155d4ac150f35e 100644 (file)
@@ -66,8 +66,6 @@ class ColorDelegator(Delegator):
         colorizing: Boolean flag when colorizing is in process.
         stop_colorizing: Boolean flag to end an active colorizing
                 process.
-        close_when_done: Widget to destroy after colorizing process
-                completes (doesn't seem to be used by IDLE).
     """
 
     def __init__(self):
@@ -157,9 +155,7 @@ class ColorDelegator(Delegator):
             self.after_id = self.after(1, self.recolorize)
         return
 
-    close_when_done = None  # Window to be closed when done colorizing.
-
-    def close(self, close_when_done=None):
+    def close(self):
         if self.after_id:
             after_id = self.after_id
             self.after_id = None
@@ -167,11 +163,6 @@ class ColorDelegator(Delegator):
             self.after_cancel(after_id)
         self.allow_colorizing = False
         self.stop_colorizing = True
-        if close_when_done:
-            if not self.colorizing:
-                close_when_done.destroy()
-            else:
-                self.close_when_done = close_when_done
 
     def toggle_colorize_event(self, event=None):
         """Toggle colorizing on and off.
@@ -205,9 +196,7 @@ class ColorDelegator(Delegator):
         process is not already running.
 
         After colorizing is complete, some cleanup is done to
-        make sure that all the text has been colorized and to close
-        the window if the close event had been called while the
-        process was running.
+        make sure that all the text has been colorized.
         """
         self.after_id = None
         if not self.delegate:
@@ -232,10 +221,6 @@ class ColorDelegator(Delegator):
         if self.allow_colorizing and self.tag_nextrange("TODO", "1.0"):
             if DEBUG: print("reschedule colorizing")
             self.after_id = self.after(1, self.recolorize)
-        if self.close_when_done:
-            top = self.close_when_done
-            self.close_when_done = None
-            top.destroy()
 
     def recolorize_main(self):
         "Evaluate text and apply colorizing tags."
index e05b52a96dcc615c6e11ef1e5a31634944ea3819..83260329640e1ad96d1275cfe4ed42fac4c5c2dc 100644 (file)
@@ -1033,7 +1033,7 @@ class EditorWindow(object):
         self.io = None
         self.undo = None
         if self.color:
-            self.color.close(False)
+            self.color.close()
             self.color = None
         self.text = None
         self.tkinter_vars = None
diff --git a/Misc/NEWS.d/next/IDLE/2019-02-28-18-52-40.bpo-36152.9pkHIU.rst b/Misc/NEWS.d/next/IDLE/2019-02-28-18-52-40.bpo-36152.9pkHIU.rst
new file mode 100644 (file)
index 0000000..b75ae89
--- /dev/null
@@ -0,0 +1,3 @@
+Remove colorizer.ColorDelegator.close_when_done and the
+corresponding argument of .close().  In IDLE, both have
+always been None or False since 2007.