-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr #106034
gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr #106034
Conversation
…bject_HasAttr These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.
} | ||
if (!PySequence_Check(notes) || PyUnicode_Check(notes) || PyBytes_Check(notes)) { | ||
int res = 0; | ||
res = 0; |
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.
is there a reason not to have this local to the block?
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.
It will hide the same named variable in the outer block. It looks errorprone, even if it does not do wrong in this case. The compiler can complain, and I would not blame it on this.
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
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry @serhiy-storchaka, I had trouble checking out the |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
…and PyObject_HasAttr (pythonGH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.. (cherry picked from commit 1d33d53) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-106040 is a backport of this pull request to the 3.11 branch. |
GH-106041 is a backport of this pull request to the 3.12 branch. |
…and PyObject_HasAttr (pythonGH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code. (cherry picked from commit 1d33d53) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
#106041) [3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code. (cherry picked from commit 1d33d53)
#106040) [3.11] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.. (cherry picked from commit 1d33d53)
These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.