summaryrefslogtreecommitdiffstats
path: root/Tools/idle
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-06-10 14:44:48 (GMT)
committerGuido van Rossum <guido@python.org>1999-06-10 14:44:48 (GMT)
commite2571f2ce78189bdd35c3659c6fcbed584528813 (patch)
treee00fe4ef821f13f3e7252a16041a54175ed8f59e /Tools/idle
parenta3b4a33f3b37870096c8062af1dd6bae051af30e (diff)
downloadcpython-e2571f2ce78189bdd35c3659c6fcbed584528813.zip
cpython-e2571f2ce78189bdd35c3659c6fcbed584528813.tar.gz
cpython-e2571f2ce78189bdd35c3659c6fcbed584528813.tar.bz2
Fix off-by-one error in Tim's recent change to comment_region(): the
list of lines returned by get_region() contains an empty line at the end representing the start of the next line, and this shouldn't be commented out!
Diffstat (limited to 'Tools/idle')
-rw-r--r--Tools/idle/AutoIndent.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Tools/idle/AutoIndent.py b/Tools/idle/AutoIndent.py
index 1bdb05b..7784254 100644
--- a/Tools/idle/AutoIndent.py
+++ b/Tools/idle/AutoIndent.py
@@ -347,7 +347,7 @@ class AutoIndent:
def comment_region_event(self, event):
head, tail, chars, lines = self.get_region()
- for pos in range(len(lines)):
+ for pos in range(len(lines) - 1):
line = lines[pos]
lines[pos] = '##' + line
self.set_region(head, tail, chars, lines)