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

In the font configuration window, remove duplicated font names.
(cherry picked from commit ed335cf53b)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2020-02-10 13:38:30 -08:00 committed by GitHub
parent a83d910806
commit 021a5694ed
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.