Skip to content

Commit dda12ad

Browse files
bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic linked with Tk >= 8.5 (GH-23955)
(cherry picked from commit b02ad24) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent ed48e9e commit dda12ad

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Lib/test/test_tcl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@ def testUnsetVarException(self):
136136

137137
def get_integers(self):
138138
integers = (0, 1, -1, 2**31-1, -2**31, 2**31, -2**31-1, 2**63-1, -2**63)
139-
# bignum was added in Tcl 8.5, but its support is able only since 8.5.8
140-
if (get_tk_patchlevel() >= (8, 6, 0, 'final') or
141-
(8, 5, 8) <= get_tk_patchlevel() < (8, 6)):
142-
integers += (2**63, -2**63-1, 2**1000, -2**1000)
139+
# bignum was added in Tcl 8.5, but its support is able only since 8.5.8.
140+
# Actually it is determined at compile time, so using get_tk_patchlevel()
141+
# is not reliable.
142+
# TODO: expose full static version.
143+
if tcl_version >= (8, 5):
144+
v = get_tk_patchlevel()
145+
if v >= (8, 6, 0, 'final') or (8, 5, 8) <= v < (8, 6):
146+
integers += (2**63, -2**63-1, 2**1000, -2**1000)
143147
return integers
144148

145149
def test_getint(self):

0 commit comments

Comments
 (0)