[Python-checkins] cpython (2.7): #16887: IDLE now accepts Cancel in tabify/untabify dialog box.

roger.serwy python-checkins at python.org
Sun Apr 7 03:31:56 CEST 2013


http://hg.python.org/cpython/rev/d7aa625147f7
changeset:   83169:d7aa625147f7
branch:      2.7
user:        Roger Serwy <roger.serwy at gmail.com>
date:        Sat Apr 06 20:26:53 2013 -0500
summary:
  #16887: IDLE now accepts Cancel in tabify/untabify dialog box.

files:
  Lib/idlelib/EditorWindow.py |  4 +++-
  Misc/NEWS                   |  2 ++
  2 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -1425,6 +1425,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:
@@ -1436,6 +1437,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)
@@ -1529,7 +1531,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
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -21,6 +21,8 @@
 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.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list