diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2013-07-13 00:18:33 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2013-07-13 00:18:33 (GMT) |
commit | fccb0d2d0d151bcba9630c0d879b95602dc870e2 (patch) | |
tree | 3b2c150ee62b192cf7e635f0c541ded29776ccbe /Lib/idlelib | |
parent | 16c107046f18562955448849e7abc02af89b3fb2 (diff) | |
download | cpython-fccb0d2d0d151bcba9630c0d879b95602dc870e2.zip cpython-fccb0d2d0d151bcba9630c0d879b95602dc870e2.tar.gz cpython-fccb0d2d0d151bcba9630c0d879b95602dc870e2.tar.bz2 |
Issue #18365: normalize whitespace
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/idle_test/mock_tk.py | 12 | ||||
-rw-r--r-- | Lib/idlelib/idle_test/test_text.py | 3 |
2 files changed, 7 insertions, 8 deletions
diff --git a/Lib/idlelib/idle_test/mock_tk.py b/Lib/idlelib/idle_test/mock_tk.py index a12db13..279f4be 100644 --- a/Lib/idlelib/idle_test/mock_tk.py +++ b/Lib/idlelib/idle_test/mock_tk.py @@ -210,7 +210,7 @@ class Text(object): endline, endchar = startline+1, 0 else: # do not delete terminal \n if index1 == 'insert' - return + return else: endline, endchar = self._decode(index2, -1) # restricting end position to insert position excludes terminal \n @@ -219,11 +219,11 @@ class Text(object): self.data[startline] = self.data[startline][:startchar] + \ self.data[startline][endchar:] elif startline < endline: - self.data[startline] = self.data[startline][:startchar] + \ - self.data[endline][endchar:] - startline += 1 - for i in range(startline, endline+1): - del self.data[startline] + self.data[startline] = self.data[startline][:startchar] + \ + self.data[endline][endchar:] + startline += 1 + for i in range(startline, endline+1): + del self.data[startline] def compare(self, index1, op, index2): line1, char1 = self._decode(index1) diff --git a/Lib/idlelib/idle_test/test_text.py b/Lib/idlelib/idle_test/test_text.py index 69419c1..367bf38 100644 --- a/Lib/idlelib/idle_test/test_text.py +++ b/Lib/idlelib/idle_test/test_text.py @@ -36,7 +36,7 @@ class TextTest(object): self.assertEqual(index(dex), '1.0') for dex in '1.0 lineend', '1.end', '1.33': - self.assertEqual(index(dex), '1.5') + self.assertEqual(index(dex), '1.5') for dex in 'end', '33.44': self.assertEqual(index(dex), '3.0') @@ -225,4 +225,3 @@ class TkTextTest(TextTest, unittest.TestCase): if __name__ == '__main__': unittest.main(verbosity=2, exit=False) - |