[Python-checkins] cpython (merge 3.3 -> default): Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.

serhiy.storchaka python-checkins at python.org
Mon Nov 4 21:12:55 CET 2013


http://hg.python.org/cpython/rev/fe5a829bd645
changeset:   86925:fe5a829bd645
parent:      86921:ac1685661b07
parent:      86924:583347b79aa0
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Nov 04 22:11:43 2013 +0200
summary:
  Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.

files:
  Lib/tkinter/test/widget_tests.py |  14 +++++++++++++-
  1 files changed, 13 insertions(+), 1 deletions(-)


diff --git a/Lib/tkinter/test/widget_tests.py b/Lib/tkinter/test/widget_tests.py
--- a/Lib/tkinter/test/widget_tests.py
+++ b/Lib/tkinter/test/widget_tests.py
@@ -8,10 +8,22 @@
 
 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
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list