# HG changeset patch # User Ned Deily # Date 1286241461 25200 # Branch py3k # Node ID bcfedbfcc1f01637a50005ecb16b84500948a7da # Parent a88fe908dfabffa8f289a43f00b1a89e4053f295 issue9989 fix 1 - ensure the font to be tested actually exists, if not create it (there seem to be differences in behavior depending on the Tk version) diff -r a88fe908dfab -r bcfedbfcc1f0 Lib/tkinter/test/test_tkinter/test_font.py --- Lib/tkinter/test/test_tkinter/test_font.py Sat Oct 02 02:03:31 2010 +0200 +++ Lib/tkinter/test/test_tkinter/test_font.py Mon Oct 04 18:17:41 2010 -0700 @@ -15,8 +15,13 @@ support.root_withdraw() def test_font_eq(self): - font1 = font.nametofont("TkDefaultFont") - font2 = font.nametofont("TkDefaultFont") + fontname = "TkDefaultFont" + try: + f = font.Font(name=fontname, exists=True) + except tkinter._tkinter.TclError: + f = font.Font(name=fontname, exists=False) + font1 = font.nametofont(fontname) + font2 = font.nametofont(fontname) self.assertIsNot(font1, font2) self.assertEqual(font1, font2) self.assertNotEqual(font1, font1.copy())