[Python-checkins] bpo-39600, IDLE: Remove duplicated font names (GH-18430)

Miss Islington (bot) webhook-mailer at python.org
Mon Feb 10 16:39:47 EST 2020


https://github.com/python/cpython/commit/2e8097d1c7c04dd96061ec1498cfa088bce9085b
commit: 2e8097d1c7c04dd96061ec1498cfa088bce9085b
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-02-10T13:39:43-08:00
summary:

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


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

Co-authored-by: Victor Stinner <vstinner at python.org>

files:
A Misc/NEWS.d/next/IDLE/2020-02-10-17-09-48.bpo-39600.X6NsyM.rst
M Lib/idlelib/configdialog.py

diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py
index 22359735874d1..7b844f00e7736 100644
--- a/Lib/idlelib/configdialog.py
+++ b/Lib/idlelib/configdialog.py
@@ -607,8 +607,9 @@ def load_font_cfg(self):
         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
index 0000000000000..102aa75f5813e
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2020-02-10-17-09-48.bpo-39600.X6NsyM.rst
@@ -0,0 +1 @@
+In the font configuration window, remove duplicated font names.



More information about the Python-checkins mailing list