44from tkinter import TclError
55import enum
66from test import support
7- from test .test_tkinter .support import AbstractTkTest , AbstractDefaultRootTest , requires_tk
7+ from test .test_tkinter .support import AbstractTkTest , AbstractDefaultRootTest , requires_tk , tk_version
88
99support .requires ('gui' )
1010
11+ if tk_version < (9 ,0 ):
12+ from test .test_tkinter .support import messages_v1 as messages
13+ else :
14+ from test .test_tkinter .support import messages_v2 as messages
15+
1116class MiscTest (AbstractTkTest , unittest .TestCase ):
1217
1318 def test_all (self ):
@@ -66,9 +71,9 @@ def test_tk_busy(self):
6671 f .tk_busy_forget ()
6772 self .assertFalse (f .tk_busy_status ())
6873 self .assertFalse (f .tk_busy_current ())
69- with self .assertRaisesRegex (TclError , "can't find busy window" ):
74+ with self .assertRaisesRegex (TclError , messages [ 'no_busy' ] ):
7075 f .tk_busy_configure ()
71- with self .assertRaisesRegex (TclError , "can't find busy window" ):
76+ with self .assertRaisesRegex (TclError , messages [ 'no_busy' ] ):
7277 f .tk_busy_forget ()
7378
7479 @requires_tk (8 , 6 , 6 )
@@ -87,7 +92,8 @@ def test_tk_busy_with_cursor(self):
8792 self .assertEqual (f .tk_busy_configure ('cursor' )[4 ], 'heart' )
8893
8994 f .tk_busy_forget ()
90- with self .assertRaisesRegex (TclError , "can't find busy window" ):
95+ print ('>>>>>2' , messages ['no_busy' ])
96+ with self .assertRaisesRegex (TclError , messaages ["no_busy" ]):
9197 f .tk_busy_cget ('cursor' )
9298
9399 def test_tk_setPalette (self ):
0 commit comments