Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20acaa7

Browse files
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
2 parents 3daaf5f + 8d8599c commit 20acaa7

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

Lib/tkinter/test/widget_tests.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,22 @@
88

99
noconv = str if tcl_version < (8, 5) else False
1010

11+
pixels_round = round
12+
if tcl_version[:2] == (8, 5):
13+
# Issue #19085: Workaround a bug in Tk
14+
# http://core.tcl.tk/tk/info/3497848
15+
root = setup_master()
16+
patchlevel = root.call('info', 'patchlevel')
17+
patchlevel = tuple(map(int, patchlevel.split('.')))
18+
if patchlevel < (8, 5, 12):
19+
pixels_round = int
20+
del root
21+
22+
1123
_sentinel = object()
1224

1325
class AbstractWidgetTest:
14-
_conv_pixels = round
26+
_conv_pixels = pixels_round
1527
_conv_pad_pixels = None
1628
wantobjects = True
1729

0 commit comments

Comments
 (0)