Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f92e78

Browse files
committed
Fix test_tk under OS X with Tk 8.4. Patch by Ned Deily.
This should fix some buildbot failures.
1 parent eeed955 commit 2f92e78

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Lib/tkinter/test/test_tkinter/test_font.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ def tearDown(self):
1515
support.root_withdraw()
1616

1717
def test_font_eq(self):
18-
font1 = font.nametofont("TkDefaultFont")
19-
font2 = font.nametofont("TkDefaultFont")
18+
fontname = "TkDefaultFont"
19+
try:
20+
f = font.Font(name=fontname, exists=True)
21+
except tkinter._tkinter.TclError:
22+
f = font.Font(name=fontname, exists=False)
23+
font1 = font.nametofont(fontname)
24+
font2 = font.nametofont(fontname)
2025
self.assertIsNot(font1, font2)
2126
self.assertEqual(font1, font2)
2227
self.assertNotEqual(font1, font1.copy())

0 commit comments

Comments
 (0)