4
4
from tkinter import TclError
5
5
import enum
6
6
from 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
8
8
9
9
support .requires ('gui' )
10
10
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
+
11
16
class MiscTest (AbstractTkTest , unittest .TestCase ):
12
17
13
18
def test_all (self ):
@@ -66,9 +71,9 @@ def test_tk_busy(self):
66
71
f .tk_busy_forget ()
67
72
self .assertFalse (f .tk_busy_status ())
68
73
self .assertFalse (f .tk_busy_current ())
69
- with self .assertRaisesRegex (TclError , "can't find busy window" ):
74
+ with self .assertRaisesRegex (TclError , messages [ 'no_busy' ] ):
70
75
f .tk_busy_configure ()
71
- with self .assertRaisesRegex (TclError , "can't find busy window" ):
76
+ with self .assertRaisesRegex (TclError , messages [ 'no_busy' ] ):
72
77
f .tk_busy_forget ()
73
78
74
79
@requires_tk (8 , 6 , 6 )
@@ -87,7 +92,8 @@ def test_tk_busy_with_cursor(self):
87
92
self .assertEqual (f .tk_busy_configure ('cursor' )[4 ], 'heart' )
88
93
89
94
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" ]):
91
97
f .tk_busy_cget ('cursor' )
92
98
93
99
def test_tk_setPalette (self ):
0 commit comments