-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Check the result of PySet_Contains() for error in Python/symtable.c #109146
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
Check the result of PySet_Contains() for error in Python/symtable.c #109146
Conversation
8c6ace8
to
a8f1311
Compare
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.
@@ -543,14 +544,22 @@ analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags, | |||
"nonlocal declaration not allowed at module level"); | |||
return error_at_directive(ste, name); |
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.
Remark unrelated to you PR. I don't understand why an exception is raised before calling error_at_directive() which seems to always override the current exception (and not chain the new one to the currently raised one).
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.
No, it only sets location in the raised SyntaxError.
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.
I looked again at PyErr_SyntaxLocationObjectEx(): oh, you're right. Now it makes sense, thanks :-)
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
…ythonGH-109146) (cherry picked from commit 87a7faf) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-109153 is a backport of this pull request to the 3.12 branch. |
Nice fix, it's good to check for errors :-) |
…ble.c (pythonGH-109146). (cherry picked from commit 87a7faf) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-109158 is a backport of this pull request to the 3.11 branch. |
…ble.c (GH-109146) (#109153) Check the result of PySet_Contains() for error in Python/symtable.c (GH-109146) (cherry picked from commit 87a7faf) Co-authored-by: Serhiy Storchaka <[email protected]>
No description provided.