Visitar URL original
[3.13] gh-159015: Fix test_math import on musl by agners 路 Pull Request #159016 路 python/cpython 路 GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[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 <noreply@anthropic.com>
  • Loading branch information
agners and claude committed Oct 8, 2026
commit c4e26d397ceb53a4ef534711014b42435bb644e7
2 changes: 1 addition & 1 deletion Lib/test/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Loading