Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update split to splitlist
  • Loading branch information
csabella committed Jun 20, 2020
commit d6f80e81820e9c00f69aebd870b1574d9e6e3c2d
12 changes: 6 additions & 6 deletions Lib/idlelib/idle_test/test_textview.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ def test_increase_font_size_tuple(self):
eq = self.assertEqual
text.focus_set()

eq(text.tk.split(text['font'])[1], '45')
eq(text.tk.splitlist(text['font'])[1], '45')
text.event_generate('<<increase_font_size>>')
eq(text.tk.split(text['font'])[1], '46')
eq(text.tk.splitlist(text['font'])[1], '46')
text.event_generate('<<increase_font_size>>')
eq(text.tk.split(text['font'])[1], '47')
eq(text.tk.splitlist(text['font'])[1], '47')

def test_decrease_font_size_tuple(self):
text = self.text
Expand All @@ -294,11 +294,11 @@ def test_decrease_font_size_tuple(self):
eq = self.assertEqual
text.focus_set()

eq(text.tk.split(text['font'])[1], '45')
eq(text.tk.splitlist(text['font'])[1], '45')
text.event_generate('<<decrease_font_size>>')
eq(text.tk.split(text['font'])[1], '44')
eq(text.tk.splitlist(text['font'])[1], '44')
text.event_generate('<<decrease_font_size>>')
eq(text.tk.split(text['font'])[1], '43')
eq(text.tk.splitlist(text['font'])[1], '43')


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion Lib/idlelib/textview.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def resize(fontname):
font = Font(self.text, name=fontname, exists=True)
font['size'] = new_size(font['size'])
except TclError:
font = list(self.text.tk.split(fontname))
font = list(self.text.tk.splitlist(fontname))
if len(font) > 1:
font[1] = new_size(int(font[1]))
return font
Expand Down