diff options
author | Guido van Rossum <guido@python.org> | 1999-06-10 14:44:48 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-06-10 14:44:48 (GMT) |
commit | e2571f2ce78189bdd35c3659c6fcbed584528813 (patch) | |
tree | e00fe4ef821f13f3e7252a16041a54175ed8f59e /Tools | |
parent | a3b4a33f3b37870096c8062af1dd6bae051af30e (diff) | |
download | cpython-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')
-rw-r--r-- | Tools/idle/AutoIndent.py | 2 |
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) |