From c4e26d397ceb53a4ef534711014b42435bb644e7 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 8 Oct 2026 12:27:22 +0200 Subject: [PATCH] [3.13] gh-159015: Fix test_math import on musl The 3.13 backport of gh-152563 compares the return value of support.linked_to_musl() with a version tuple, but on 3.13 the helper still returns a bool. On musl this raises TypeError at class definition time, so test_math and test_cmath fail to import. Restore the previous skip condition. Co-Authored-By: Claude Opus 5.5 --- Lib/test/test_math.py | 2 +- .../next/Tests/2026-10-08-10-27-15.gh-issue-159015.SYk8R8.rst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2026-10-08-10-27-15.gh-issue-159015.SYk8R8.rst diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index b678420e9cf1f9d..eac5a1c765b6df5 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -2743,7 +2743,7 @@ def test_fma_infinities(self): @unittest.skipIf( sys.platform.startswith(("freebsd", "wasi", "netbsd", "emscripten")) or (sys.platform == "android" and platform.machine() == "x86_64") - or (support.linked_to_musl() and support.linked_to_musl() < (1, 2, 6)), # gh-131032 + or support.linked_to_musl(), # gh-131032 f"this platform doesn't implement IEE 754-2008 properly") def test_fma_zero_result(self): nonnegative_finites = [0.0, 1e-300, 2.3, 1e300] diff --git a/Misc/NEWS.d/next/Tests/2026-10-08-10-27-15.gh-issue-159015.SYk8R8.rst b/Misc/NEWS.d/next/Tests/2026-10-08-10-27-15.gh-issue-159015.SYk8R8.rst new file mode 100644 index 000000000000000..5b3cba900b672e2 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-10-08-10-27-15.gh-issue-159015.SYk8R8.rst @@ -0,0 +1,3 @@ +Fix :mod:`!test.test_math` failing to import on musl-based systems. The +skip condition of ``test_fma_zero_result`` compared the boolean returned by +:func:`!test.support.linked_to_musl` with a version tuple.