Commit 9402533c authored by Serhiy Storchaka's avatar Serhiy Storchaka

Fixed tests with Tcl/Tk <8.5 (closes #18964).

parent 023c3e74
...@@ -13,6 +13,14 @@ _tkinter = test_support.import_module('_tkinter') ...@@ -13,6 +13,14 @@ _tkinter = test_support.import_module('_tkinter')
from Tkinter import Tcl from Tkinter import Tcl
from _tkinter import TclError from _tkinter import TclError
tcl_version = _tkinter.TCL_VERSION.split('.')
try:
for i in range(len(tcl_version)):
tcl_version[i] = int(tcl_version[i])
except ValueError:
pass
tcl_version = tuple(tcl_version)
class TkinterTest(unittest.TestCase): class TkinterTest(unittest.TestCase):
...@@ -209,6 +217,9 @@ class TclTest(unittest.TestCase): ...@@ -209,6 +217,9 @@ class TclTest(unittest.TestCase):
(('a', 3.4), ('a', 3.4)), (('a', 3.4), ('a', 3.4)),
((), ()), ((), ()),
(call('list', 1, '2', (3.4,)), (1, '2', (3.4,))), (call('list', 1, '2', (3.4,)), (1, '2', (3.4,))),
]
if tcl_version >= (8, 5):
testcases += [
(call('dict', 'create', 1, u'\u20ac', '\xe2\x82\xac', (3.4,)), (call('dict', 'create', 1, u'\u20ac', '\xe2\x82\xac', (3.4,)),
(1, u'\u20ac', u'\u20ac', (3.4,))), (1, u'\u20ac', u'\u20ac', (3.4,))),
] ]
...@@ -243,6 +254,9 @@ class TclTest(unittest.TestCase): ...@@ -243,6 +254,9 @@ class TclTest(unittest.TestCase):
(('a', (2, 3.4)), ('a', (2, 3.4))), (('a', (2, 3.4)), ('a', (2, 3.4))),
((), ()), ((), ()),
(call('list', 1, '2', (3.4,)), (1, '2', (3.4,))), (call('list', 1, '2', (3.4,)), (1, '2', (3.4,))),
]
if tcl_version >= (8, 5):
testcases += [
(call('dict', 'create', 12, u'\u20ac', '\xe2\x82\xac', (3.4,)), (call('dict', 'create', 12, u'\u20ac', '\xe2\x82\xac', (3.4,)),
(12, u'\u20ac', u'\u20ac', (3.4,))), (12, u'\u20ac', u'\u20ac', (3.4,))),
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment