You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
3.13.16: test_math fails to import on musl (linked_to_musl() returns bool, compared to tuple) #159015
The 3.13 backport of gh-152563 (#155753, commit 8e85d73) changed the skip condition of FMATests.test_fma_zero_result in Lib/test/test_math.py to:
or (support.linked_to_musl() andsupport.linked_to_musl() < (1, 2, 6)), # gh-131032
On main/3.14, support.linked_to_musl() returns the musl version as a tuple. On the 3.13 branch it still returns a plain bool (return ('musl' in stdout)), so on a musl-based system the condition evaluates True < (1, 2, 6) and raises:
TypeError: '<' not supported between instances of 'bool' and 'tuple'
Because this happens inside the @unittest.skipIf(...) decorator, it is raised at class definition time and test_math fails to import entirely. test_cmath imports from test.test_math, so it fails too. On glibc the expression short-circuits on False, so it doesn't show up there.
This is a regression in 3.13.16. A visible consequence: building 3.13.16 on Alpine Linux with --enable-optimizations fails, because both modules are part of the PGO training set:
To fix it, either restore the previous or support.linked_to_musl(), condition on 3.13, or also backport the linked_to_musl() change that returns a version tuple.
Activity
agners commentedon Oct 8, 2026
Fix for 3.13: #159016
agners commentedon Oct 8, 2026
@weixlu FYI, this is essentially a bad backport from what I can tell.
skirpichev commentedon Oct 8, 2026
v3.13 is for security fixes only. I doubt this fits...
Edit: see #159016 (review)
weixlu commentedon Oct 12, 2026
Thanks for the heads-up and for fixing the backport issue :)