Skip to content

Commit b41dc56

Browse files
bpo-33904: In IDLE's rstrip, rename class RstripExtension as Rstrip (GH-7811)
(cherry picked from commit 9bb9223) Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <[email protected]>
1 parent 2b75742 commit b41dc56

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Lib/idlelib/editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class EditorWindow(object):
5858
from idlelib.codecontext import CodeContext
5959
from idlelib.paragraph import FormatParagraph
6060
from idlelib.parenmatch import ParenMatch
61-
from idlelib.rstrip import RstripExtension
61+
from idlelib.rstrip import Rstrip
6262
from idlelib.zoomheight import ZoomHeight
6363

6464
filesystemencoding = sys.getfilesystemencoding() # for file names
@@ -310,7 +310,7 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
310310
scriptbinding = ScriptBinding(self)
311311
text.bind("<<check-module>>", scriptbinding.check_module_event)
312312
text.bind("<<run-module>>", scriptbinding.run_module_event)
313-
text.bind("<<do-rstrip>>", self.RstripExtension(self).do_rstrip)
313+
text.bind("<<do-rstrip>>", self.Rstrip(self).do_rstrip)
314314
ctip = self.Calltip(self)
315315
text.bind("<<try-open-calltip>>", ctip.try_open_calltip_event)
316316
#refresh-calltip must come after paren-closed to work right

Lib/idlelib/idle_test/test_rstrip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class rstripTest(unittest.TestCase):
99
def test_rstrip_line(self):
1010
editor = Editor()
1111
text = editor.text
12-
do_rstrip = rstrip.RstripExtension(editor).do_rstrip
12+
do_rstrip = rstrip.Rstrip(editor).do_rstrip
1313

1414
do_rstrip()
1515
self.assertEqual(text.get('1.0', 'insert'), '')
@@ -27,7 +27,7 @@ def test_rstrip_multiple(self):
2727
#from tkinter import Tk
2828
#editor = Editor(root=Tk())
2929
text = editor.text
30-
do_rstrip = rstrip.RstripExtension(editor).do_rstrip
30+
do_rstrip = rstrip.Rstrip(editor).do_rstrip
3131

3232
original = (
3333
"Line with an ending tab \n"

Lib/idlelib/rstrip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'Provides "Strip trailing whitespace" under the "Format" menu.'
22

3-
class RstripExtension:
3+
class Rstrip:
44

55
def __init__(self, editwin):
66
self.editwin = editwin
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
IDLE: In rstrip, rename class RstripExtension as Rstrip

0 commit comments

Comments
 (0)