]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
authorVictor Stinner <vstinner@python.org>
Mon, 10 Feb 2020 19:41:26 +0000 (20:41 +0100)
committerGitHub <noreply@github.com>
Mon, 10 Feb 2020 19:41:26 +0000 (11:41 -0800)
In the font configuration window, remove duplicated font names.

Lib/idlelib/configdialog.py
Misc/NEWS.d/next/IDLE/2020-02-10-17-09-48.bpo-39600.X6NsyM.rst [new file with mode: 0644]

index 22359735874d19f417ba1b66e094cb8fc009ef88..7b844f00e7736d7e903758f2d1af5c634f589702 100644 (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)
diff --git a/Misc/NEWS.d/next/IDLE/2020-02-10-17-09-48.bpo-39600.X6NsyM.rst b/Misc/NEWS.d/next/IDLE/2020-02-10-17-09-48.bpo-39600.X6NsyM.rst
new file mode 100644 (file)
index 0000000..102aa75
--- /dev/null
@@ -0,0 +1 @@
+In the font configuration window, remove duplicated font names.