Skip to content

gh-142349: Fix build errors from PEP 810 - #144726

Merged
pablogsal merged 1 commit into
python:mainfrom
pablogsal:lazy-cleanup
Feb 12, 2026
Merged

pablogsal merged 1 commit into
python:mainfrom
pablogsal:lazy-cleanup

Conversation

@pablogsal

@pablogsal pablogsal commented Feb 12, 2026 •

Copy link
Copy Markdown
Member

The PEP 810 commit added an is_lazy parameter to _PyAST_ImportFrom but did not update the test_peg_generator test that calls this function directly from a custom grammar. It also introduced a trailing comma in the PyImport_LazyImportsMode enum which is invalid under C++03 with -pedantic-errors, breaking test_cppext.

Pass 0 for the new is_lazy argument in the test grammar's _PyAST_ImportFrom calls, and remove the trailing comma from the enum definition to restore C++03 compatibility.

The PEP 810 commit added an is_lazy parameter to _PyAST_ImportFrom
but did not update the test_peg_generator test that calls this
function directly from a custom grammar. It also introduced a
trailing comma in the PyImport_LazyImportsMode enum which is
invalid under C++03 with -pedantic-errors, breaking test_cppext.

Pass 0 for the new is_lazy argument in the test grammar's
_PyAST_ImportFrom calls, and remove the trailing comma from the
enum definition to restore C++03 compatibility.
@danielhollas

Copy link
Copy Markdown
Contributor

(looks like the TSAN tests are stuck?)

@pablogsal
pablogsal merged commit 7854597 into python:main Feb 12, 2026
85 of 87 checks passed
@pablogsal
pablogsal deleted the lazy-cleanup branch February 12, 2026 08:18
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants