Skip to content

Commit 59e183c

Browse files
[3.13] gh-128846: Make tkinter tests robust against Tcl/Tk 9.0 (GH-153484)
Backport the test-only parts of the Tcl/Tk 8.7/9.0/9.1 test adaptations so that test_tkinter and test_ttk pass when Python 3.13 is built against Tcl/Tk 9.0 (for example the Homebrew build used on macOS), while still passing against the Tcl/Tk 8.6 that 3.13 ships. Combines the test changes from: * gh-124111: Update tkinter for compatibility with Tcl/Tk 9.0.0 (GH-124156) * gh-124111: test macOS CI with Tk 9 (GH-137424) * gh-145736: Fix Tkinter tests for Tk 8.7, 9.0 and 9.1 (GH-145738) The corresponding non-test changes (Modules/_tkinter.c, Lib/tkinter/ttk.py, PCbuild and CI configuration) are not backported.
1 parent 5baaa5b commit 59e183c

5 files changed

Lines changed: 339 additions & 229 deletions

File tree

Lib/test/test_tkinter/test_misc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ def test_tk_busy(self):
110110
f.tk_busy_forget()
111111
self.assertFalse(f.tk_busy_status())
112112
self.assertFalse(f.tk_busy_current())
113-
with self.assertRaisesRegex(TclError, "can't find busy window"):
113+
errmsg = r"can(no|')t find busy window.*"
114+
with self.assertRaisesRegex(TclError, errmsg):
114115
f.tk_busy_configure()
115-
with self.assertRaisesRegex(TclError, "can't find busy window"):
116+
with self.assertRaisesRegex(TclError, errmsg):
116117
f.tk_busy_forget()
117118

118119
@requires_tk(8, 6, 6)
@@ -131,7 +132,8 @@ def test_tk_busy_with_cursor(self):
131132
self.assertEqual(f.tk_busy_configure('cursor')[4], 'heart')
132133

133134
f.tk_busy_forget()
134-
with self.assertRaisesRegex(TclError, "can't find busy window"):
135+
errmsg = r"can(no|')t find busy window.*"
136+
with self.assertRaisesRegex(TclError, errmsg):
135137
f.tk_busy_cget('cursor')
136138

137139
def test_tk_setPalette(self):

0 commit comments

Comments
 (0)