From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 27 Dec 2020 08:56:40 +0000 (-0800) Subject: bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic linked... X-Git-Tag: v3.8.8rc1~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d7c5ab6a4ae9d69b39bd16c3195bf6405ddc2d1;p=thirdparty%2FPython%2Fcpython.git 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 b02ad2458bc127a7afdeef414fa68c9a7f1f32af) Co-authored-by: Serhiy Storchaka --- diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index 6005349eaac4..6ac0db4dc4a9 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -135,10 +135,14 @@ class TclTest(unittest.TestCase): def get_integers(self): 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 - if (get_tk_patchlevel() >= (8, 6, 0, 'final') or - (8, 5, 8) <= get_tk_patchlevel() < (8, 6)): - integers += (2**63, -2**63-1, 2**1000, -2**1000) + # bignum was added in Tcl 8.5, but its support is able only since 8.5.8. + # Actually it is determined at compile time, so using get_tk_patchlevel() + # is not reliable. + # 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 def test_getint(self):