Skip to content

[3.13] gh-131927: Prevent emitting optimizer warnings twice in the REPL (GH-131993) #132463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2025

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Apr 13, 2025

@picnixz picnixz changed the title [3.13] gh-131927: Prevent emitting optimizer warnings twice in the RE… [3.13] gh-131927: Prevent emitting optimizer warnings twice in the REPL Apr 13, 2025
@@ -6616,8 +6616,8 @@ compiler_warn(struct compiler *c, location loc,
if (msg == NULL) {
return ERROR;
}
if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, c->c_filename,
loc.lineno, NULL, NULL) < 0)
if (_PyErr_WarnExplicitObjectWithContext(PyExc_SyntaxWarning, msg,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note, 3.13 uses compiler_warn instead of _PyErr_EmitSyntaxWarning to emit warnings.

@picnixz picnixz changed the title [3.13] gh-131927: Prevent emitting optimizer warnings twice in the REPL [3.13] gh-131927: Prevent emitting optimizer warnings twice in the REPL (#131993) Apr 13, 2025
@picnixz picnixz changed the title [3.13] gh-131927: Prevent emitting optimizer warnings twice in the REPL (#131993) [3.13] gh-131927: Prevent emitting optimizer warnings twice in the REPL (GH-131993) Apr 13, 2025
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) April 13, 2025 08:21
@serhiy-storchaka serhiy-storchaka merged commit 4ff5d88 into python:3.13 Apr 13, 2025
38 checks passed
@tomasr8 tomasr8 deleted the backport-3d08c8a-3.13 branch April 13, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants