mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.11] gh-104496: Use correct Tcl or Tk version in Tkinter tests (GH-107688) (GH-107719)
In future Tcl and Tk versions can be desynchronized.
(cherry picked from commit 3c8e8f3cee
)
This commit is contained in:
parent
880670a34f
commit
81c8f7d619
7 changed files with 30 additions and 39 deletions
|
@ -23,14 +23,6 @@ except ImportError:
|
|||
|
||||
tcl_version = tuple(map(int, _tkinter.TCL_VERSION.split('.')))
|
||||
|
||||
_tk_patchlevel = None
|
||||
def get_tk_patchlevel():
|
||||
global _tk_patchlevel
|
||||
if _tk_patchlevel is None:
|
||||
tcl = Tcl()
|
||||
_tk_patchlevel = tcl.info_patchlevel()
|
||||
return _tk_patchlevel
|
||||
|
||||
|
||||
class TkinterTest(unittest.TestCase):
|
||||
|
||||
|
@ -574,7 +566,6 @@ class TclTest(unittest.TestCase):
|
|||
(1, '2', (3.4,)) if self.wantobjects else
|
||||
('1', '2', '3.4')),
|
||||
]
|
||||
tk_patchlevel = get_tk_patchlevel()
|
||||
if not self.wantobjects:
|
||||
expected = ('12', '\u20ac', '\xe2\x82\xac', '3.4')
|
||||
else:
|
||||
|
@ -583,8 +574,8 @@ class TclTest(unittest.TestCase):
|
|||
(call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)),
|
||||
expected),
|
||||
]
|
||||
dbg_info = ('want objects? %s, Tcl version: %s, Tk patchlevel: %s'
|
||||
% (self.wantobjects, tcl_version, tk_patchlevel))
|
||||
dbg_info = ('want objects? %s, Tcl version: %s, Tcl patchlevel: %s'
|
||||
% (self.wantobjects, tcl_version, self.interp.info_patchlevel()))
|
||||
for arg, res in testcases:
|
||||
self.assertEqual(splitlist(arg), res,
|
||||
'arg=%a, %s' % (arg, dbg_info))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue