bpo-39600, IDLE: Remove duplicated font names (GH-18430)

In the font configuration window, remove duplicated font names.
This commit is contained in:
Victor Stinner 2020-02-10 20:41:26 +01:00 committed by GitHub
parent e00c1d0c45
commit ed335cf53b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -607,8 +607,9 @@ class FontPage(Frame):
font_bold = configured_font[2]=='bold'
# Set editor font selection list and font_name.
fonts = list(tkFont.families(self))
fonts.sort()
fonts = tkFont.families(self)
# remove duplicated names and sort
fonts = sorted(set(fonts))
for font in fonts:
self.fontlist.insert(END, font)
self.font_name.set(font_name)

View File

@ -0,0 +1 @@
In the font configuration window, remove duplicated font names.