]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#16887: IDLE now accepts Cancel in tabify/untabify dialog box.
authorRoger Serwy <roger.serwy@gmail.com>
Sun, 7 Apr 2013 01:26:53 +0000 (20:26 -0500)
committerRoger Serwy <roger.serwy@gmail.com>
Sun, 7 Apr 2013 01:26:53 +0000 (20:26 -0500)
Lib/idlelib/EditorWindow.py
Misc/NEWS

index 0a01c9ec3051d3e26ab263b3cc41d70acbde57f4..96f1ee587848735a173e4553e827dbbf0805cbc4 100644 (file)
@@ -1425,6 +1425,7 @@ class EditorWindow(object):
     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:
@@ -1436,6 +1437,7 @@ class EditorWindow(object):
     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)
@@ -1529,7 +1531,7 @@ class EditorWindow(object):
             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
index 5ec6f461eee6b6c023b04cd5c8121953645e3ff3..9f145c770a24c242e27ee2b711aae1aaf0c743e9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -21,6 +21,8 @@ Library
 IDLE
 ----
 
+- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
+
 - Issue #14254: IDLE now handles readline correctly across shell restarts.
 
 - Issue #17614: IDLE no longer raises exception when quickly closing a file.