summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-02-10 21:38:30 (GMT)
committerGitHub <noreply@github.com>2020-02-10 21:38:30 (GMT)
commit021a5694ede9d7be119f9ceb3ee7e8e518ec5002 (patch)
treea248823651082aa9ff68c3d6342847a359f33640
parenta83d9108066a7a22605ba7ee962a755f4bec1ab1 (diff)
downloadcpython-021a5694ede9d7be119f9ceb3ee7e8e518ec5002.zip
cpython-021a5694ede9d7be119f9ceb3ee7e8e518ec5002.tar.gz
cpython-021a5694ede9d7be119f9ceb3ee7e8e518ec5002.tar.bz2
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@python.org>
-rw-r--r--Lib/idlelib/configdialog.py5
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-02-10-17-09-48.bpo-39600.X6NsyM.rst1
2 files changed, 4 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)
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 0000000..102aa75
--- /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.