summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-04 20:10:35 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-04 20:10:35 (GMT)
commitc4051a8e34b2ab558b42889e9592b3acaeecc95a (patch)
treefd7b0dd696463a87311444c25bbbaefe84e08bb3 /Lib/lib-tk/test
parent768e8475b1195ded8011d952be284a944cf5afbc (diff)
downloadcpython-c4051a8e34b2ab558b42889e9592b3acaeecc95a.zip
cpython-c4051a8e34b2ab558b42889e9592b3acaeecc95a.tar.gz
cpython-c4051a8e34b2ab558b42889e9592b3acaeecc95a.tar.bz2
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
Diffstat (limited to 'Lib/lib-tk/test')
-rw-r--r--Lib/lib-tk/test/widget_tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/lib-tk/test/widget_tests.py b/Lib/lib-tk/test/widget_tests.py
index 7402d91..c60673c 100644
--- a/Lib/lib-tk/test/widget_tests.py
+++ b/Lib/lib-tk/test/widget_tests.py
@@ -11,10 +11,22 @@ noconv_meth = noconv and staticmethod(noconv)
def int_round(x):
return int(round(x))
+pixels_round = int_round
+if tcl_version[:2] == (8, 5):
+ # Issue #19085: Workaround a bug in Tk
+ # http://core.tcl.tk/tk/info/3497848
+ root = setup_master()
+ patchlevel = root.call('info', 'patchlevel')
+ patchlevel = tuple(map(int, patchlevel.split('.')))
+ if patchlevel < (8, 5, 12):
+ pixels_round = int
+ del root
+
+
_sentinel = object()
class AbstractWidgetTest(object):
- _conv_pixels = staticmethod(int_round)
+ _conv_pixels = staticmethod(pixels_round)
_conv_pad_pixels = None
wantobjects = True