diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-10 19:41:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 19:41:26 (GMT) |
commit | ed335cf53b5d4bca9a08c9b83ba684ba17be0f10 (patch) | |
tree | 1fb0a9c056e046980238632e2944ca590080a9d5 /Lib | |
parent | e00c1d0c45975c0e9367f05f8c68bb32d68c2fbf (diff) | |
download | cpython-ed335cf53b5d4bca9a08c9b83ba684ba17be0f10.zip cpython-ed335cf53b5d4bca9a08c9b83ba684ba17be0f10.tar.gz cpython-ed335cf53b5d4bca9a08c9b83ba684ba17be0f10.tar.bz2 |
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
In the font configuration window, remove duplicated font names.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/configdialog.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index 2235973..7b844f0 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -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) |