◐ Shell
clean mode source ↗

gh-131927: Do not emit PEP 765 warnings in ast.parse() by serhiy-storchaka · Pull Request #139642 · python/cpython

Revert pythonGH-131993.

Fix swallowing some syntax warnings in different modules if they accidentally
have the same message and are emitted from the same line.

ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka changed the title gh-139640: Fix swallowing syntax warnings in different modules gh-139640: Fix swallowing syntax warnings in different modules (no PEP 765 warnings in ast.parse())

Oct 8, 2025

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka changed the title gh-139640: Fix swallowing syntax warnings in different modules (no PEP 765 warnings in ast.parse()) gh-139640: Do not emit PEP 765 warnings in ast.parse()

Oct 14, 2025

@serhiy-storchaka serhiy-storchaka changed the title gh-139640: Do not emit PEP 765 warnings in ast.parse() gh-131927: Do not emit PEP 765 warnings in ast.parse()

Oct 14, 2025

ncoghlan

@ncoghlan

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Oct 30, 2025
…H-139642)

ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.
(cherry picked from commit ad0a3f7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

serhiy-storchaka added a commit that referenced this pull request

Oct 30, 2025
) (GH-140786)

ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.
(cherry picked from commit ad0a3f7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request

Dec 6, 2025
…H-139642)

ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.