Skip to content

Commit 2e8097d

Browse files
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
In the font configuration window, remove duplicated font names. (cherry picked from commit ed335cf) Co-authored-by: Victor Stinner <[email protected]>
1 parent 3b888ad commit 2e8097d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Lib/idlelib/configdialog.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,9 @@ def load_font_cfg(self):
607607
font_bold = configured_font[2]=='bold'
608608

609609
# Set editor font selection list and font_name.
610-
fonts = list(tkFont.families(self))
611-
fonts.sort()
610+
fonts = tkFont.families(self)
611+
# remove duplicated names and sort
612+
fonts = sorted(set(fonts))
612613
for font in fonts:
613614
self.fontlist.insert(END, font)
614615
self.font_name.set(font_name)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In the font configuration window, remove duplicated font names.

0 commit comments

Comments
 (0)