bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic linked with Tk >= 8.5 (GH-23955)

This commit is contained in:
Serhiy Storchaka 2020-12-27 10:13:30 +02:00 committed by GitHub
parent f4507231e3
commit b02ad2458b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -138,10 +138,14 @@ class TclTest(unittest.TestCase):
def get_integers(self): def get_integers(self):
integers = (0, 1, -1, 2**31-1, -2**31, 2**31, -2**31-1, 2**63-1, -2**63) integers = (0, 1, -1, 2**31-1, -2**31, 2**31, -2**31-1, 2**63-1, -2**63)
# bignum was added in Tcl 8.5, but its support is able only since 8.5.8 # bignum was added in Tcl 8.5, but its support is able only since 8.5.8.
if (get_tk_patchlevel() >= (8, 6, 0, 'final') or # Actually it is determined at compile time, so using get_tk_patchlevel()
(8, 5, 8) <= get_tk_patchlevel() < (8, 6)): # is not reliable.
integers += (2**63, -2**63-1, 2**1000, -2**1000) # TODO: expose full static version.
if tcl_version >= (8, 5):
v = get_tk_patchlevel()
if v >= (8, 6, 0, 'final') or (8, 5, 8) <= v < (8, 6):
integers += (2**63, -2**63-1, 2**1000, -2**1000)
return integers return integers
def test_getint(self): def test_getint(self):