Skip to content

Commit 9d7c5ab

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

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
@@ -135,10 +135,14 @@ def testUnsetVarException(self):
135135

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

144148
def test_getint(self):

0 commit comments

Comments
 (0)