summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
authorRoger Serwy <roger.serwy@gmail.com>2013-04-07 01:31:26 (GMT)
committerRoger Serwy <roger.serwy@gmail.com>2013-04-07 01:31:26 (GMT)
commitcdbb06c15cadc818f22ee54901138545874452a6 (patch)
tree7a17667c8734cf56d87ab9e000356812ab111ee3 /Lib/idlelib/EditorWindow.py
parentee57f159afcba5aeca24a064a114ab441419a820 (diff)
parent0ef392cde7e088fce776581dacdb459ac39b5e7b (diff)
downloadcpython-cdbb06c15cadc818f22ee54901138545874452a6.zip
cpython-cdbb06c15cadc818f22ee54901138545874452a6.tar.gz
cpython-cdbb06c15cadc818f22ee54901138545874452a6.tar.bz2
#16887: merge with 3.3.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 565cf36..148a1da 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -1433,6 +1433,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:
@@ -1444,6 +1445,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)
@@ -1537,7 +1539,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