Skip to content

Commit 5ba0ff1

Browse files
terryjreedymiss-islington
authored andcommitted
Remove duplicate button_ok code in idlelib.textview (GH-153733)
(cherry picked from commit c5530cc) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
1 parent 28c0653 commit 5ba0ff1

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Lib/idlelib/textview.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ def __init__(self, parent, contents, wrap='word'):
9292
color_config(text)
9393
text.focus_set()
9494

95-
self.button_ok = button_ok = Button(
95+
self.button_ok = Button(
9696
self, text='Close', command=self.ok, takefocus=False)
9797
self.textframe.pack(side='top', expand=True, fill='both')
98-
button_ok.pack(side='bottom')
98+
self.button_ok.pack(side='bottom')
9999

100100
def ok(self, event=None):
101101
"""Dismiss text viewer dialog."""
@@ -127,10 +127,8 @@ def __init__(self, parent, title, contents, modal=True, wrap=WORD,
127127
self.geometry(f'=750x500+{x}+{y}')
128128

129129
self.title(title)
130-
self.viewframe = ViewFrame(self, contents, wrap=wrap)
131130
self.protocol("WM_DELETE_WINDOW", self.ok)
132-
self.button_ok = Button(self, text='Close',
133-
command=self.ok, takefocus=False)
131+
self.viewframe = ViewFrame(self, contents, wrap=wrap)
134132
self.viewframe.pack(side='top', expand=True, fill='both')
135133

136134
self.is_modal = modal

0 commit comments

Comments
 (0)