Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| if (!PySequence_Check(notes) || PyUnicode_Check(notes) || PyBytes_Check(notes)) { | ||
| int res = 0; | ||
| res = 0; |
There was a problem hiding this comment.
is there a reason not to have this local to the block?
There was a problem hiding this comment.
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.
miss-islington
commented
Jun 23, 2023
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
miss-islington
commented
Jun 23, 2023
Sorry @serhiy-storchaka, I had trouble checking out the |
miss-islington
commented
Jun 23, 2023
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>
bedevere-bot
commented
Jun 23, 2023
GH-106040 is a backport of this pull request to the 3.11 branch. |
bedevere-bot
commented
Jun 23, 2023
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.