Skip to content

Commit b02ad24

Browse files
bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic linked with Tk >= 8.5 (GH-23955)
1 parent f450723 commit b02ad24

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Lib/test/test_tcl.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,14 @@ def testUnsetVarException(self):
138138

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

147151
def test_getint(self):

0 commit comments

Comments
 (0)