changeset 83170:5451b82104f3 3.3

#16887: IDLE now accepts Cancel in tabify/untabify dialog box.
author Roger Serwy <roger.serwy@gmail.com>
date Sat, 06 Apr 2013 20:26:53 -0500
parents 7b75f0bd9a5e
children 54f6d8c4dfaf 90843e0d1912
files Lib/idlelib/EditorWindow.py Misc/NEWS
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/idlelib/EditorWindow.py	Sat Apr 06 22:52:34 2013 +0300
+++ b/Lib/idlelib/EditorWindow.py	Sat Apr 06 20:26:53 2013 -0500
@@ -1433,6 +1433,7 @@
     def tabify_region_event(self, event):
         head, tail, chars, lines = self.get_region()
         tabwidth = self._asktabwidth()
+        if tabwidth is None: return
         for pos in range(len(lines)):
             line = lines[pos]
             if line:
@@ -1444,6 +1445,7 @@
     def untabify_region_event(self, event):
         head, tail, chars, lines = self.get_region()
         tabwidth = self._asktabwidth()
+        if tabwidth is None: return
         for pos in range(len(lines)):
             lines[pos] = lines[pos].expandtabs(tabwidth)
         self.set_region(head, tail, chars, lines)
@@ -1537,7 +1539,7 @@
             parent=self.text,
             initialvalue=self.indentwidth,
             minvalue=2,
-            maxvalue=16) or self.tabwidth
+            maxvalue=16)
 
     # Guess indentwidth from text content.
     # Return guessed indentwidth.  This should not be believed unless
--- a/Misc/NEWS	Sat Apr 06 22:52:34 2013 +0300
+++ b/Misc/NEWS	Sat Apr 06 20:26:53 2013 -0500
@@ -33,6 +33,8 @@
 IDLE
 ----
 
+- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
+
 - Issue #17625: In IDLE, close the replace dialog after it is used.
 
 - Issue #14254: IDLE now handles readline correctly across shell restarts.