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#106034serhiy-storchaka merged 2 commits intopython:mainpython/cpython:mainfrom serhiy-storchaka:no-use-PyDict_GetItem-and-PyObject_HasAttrserhiy-storchaka/cpython:no-use-PyDict_GetItem-and-PyObject_HasAttrCopy head branch name to clipboard
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.
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.
|
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.