Skip to content

Commit 07fd383

Browse files
gh-161441: Fix tkinter and IDLE tests failing with new Tcl/Tk
* Generated events are not delivered to widgets whose window does not exist yet. Realize the widgets before generating events for them. * A named font whose name is a font description was never supported. Remove the check for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 5346059 commit 07fd383

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎Lib/idlelib/idle_test/test_editmenu.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ def setUpClass(cls):
2323
cls.entry = tk.Entry(root)
2424
cls.tentry = ttk.Entry(root)
2525
cls.spin = tk.Spinbox(root)
26+
# Generated events are not delivered to widgets whose window
27+
# does not exist yet.
28+
for widget in cls.text, cls.entry, cls.tentry, cls.spin:
29+
widget.winfo_id()
2630
root.clipboard_clear()
2731
root.clipboard_append('two')
2832

‎Lib/test/test_tkinter/test_font.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,6 @@ def test_equality(self):
250250
self.assertEqual(w1, w2)
251251
w3 = font.Font(root=self.root, font=('Times', 12), exists=True)
252252
self.assertNotEqual(w1, w3)
253-
# A wrapped description never equals a named font, even one whose name
254-
# is the string form of the description.
255-
named = font.Font(root=self.root, name=str(w1), family='Courier')
256-
self.assertNotEqual(w1, named)
257-
self.assertNotEqual(named, w1)
258253

259254
self.assertNotEqual(font1, 0)
260255
self.assertEqual(font1, ALWAYS_EQ)

0 commit comments

Comments
 (0)