GeezerVison is showing github.com — [3.13] gh-159015: Fix test_math import on musl by agners · Pull Request #159016 · python/cpython
Conversation
The 3.13 backport of gh-152563 (#155753) changed the skip condition of test_fma_zero_result to support.linked_to_musl() < (1, 2, 6). That works on main/3.14, where linked_to_musl() returns the musl version tuple (gh-90548). On 3.13 it still returns a bool, so on musl the condition raises TypeError while the class is being defined. test_math then fails to import, and test_cmath (which imports from it) fails too. This breaks --enable-optimizations builds of 3.13.16 on Alpine.
This PR restores the previous condition, so the test is skipped on musl again, as it was before 3.13.16. It's a 3.13-only fix; main and 3.14 are not affected.
cc @vstinner
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The 3.13 backport of pythongh-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 <[email protected]>
|
All commit authors signed the Contributor License Agreement.

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The issue #159015 prevents building Python with PGO on Alpine Linux, it's quite bad. IMO the issue is important enough to justify merging it in the 3.13 security-only branch.
@Yhg1s: Would you be ok to include this fix?
Currently, test_math fails this way on Alpine Linux:
~/python/3.13 # ./python -m test -v test_math
...
test test_math crashed -- Traceback (most recent call last):
...
TypeError: '<' not supported between instances of 'bool' and 'tuple'
The only Alpine buildbot that we have didn't catch this major regression because it only runs on Python 3.14 and newer:
cpw(
name="ware-alpine",
tags=['linux', 'unix', 'alpine', 'docker', 'amd64', 'x86-64', 'musl'],
branches=BRANCHES.only_since(3, 14),
parallel_tests=6,
),
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
agners
added a commit
to home-assistant/docker-base
that referenced
this pull request
Oct 26, 2026
sairon
pushed a commit
to home-assistant/docker-base
that referenced
this pull request
Oct 26, 2026
Reviewers
vstinner
vstinner approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
tests
Tests in the Lib/test dir
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|