]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 4 Nov 2013 20:11:12 +0000 (22:11 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 4 Nov 2013 20:11:12 +0000 (22:11 +0200)
Lib/tkinter/test/widget_tests.py

index 83db28b8afe4a43c530392a2c88f2a5e4f247c42..28cc9861790673d25b75778e22c715ec189e67bb 100644 (file)
@@ -8,10 +8,22 @@ from tkinter.test.support import (tcl_version, requires_tcl, pixels_conv,
 
 noconv = str if tcl_version < (8, 5) else False
 
+pixels_round = 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:
-    _conv_pixels = round
+    _conv_pixels = pixels_round
     _conv_pad_pixels = None
     wantobjects = True