Skip to content

[3.13] gh-159015: Fix test_math import on musl - #159016

Open
agners wants to merge 1 commit into
python:3.13from
agners:gh-159015-test-math-musl
Open

agners wants to merge 1 commit into
python:3.13from
agners:gh-159015-test-math-musl

Conversation

@agners

@agners agners commented Oct 8, 2026

Copy link
Copy Markdown

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

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 <noreply@anthropic.com>
@python-cla-bot

python-cla-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app bedevere-app Bot added awaiting review tests Tests in the Lib/test dir labels Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant