-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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-125170: Hard deprecate PyEval_GetLocals
in 3.14
#128348
Conversation
Misc/NEWS.d/next/C_API/2024-12-30-15-45-37.gh-issue-125170.Jdo8RC.rst
Outdated
Show resolved
Hide resolved
04e97fb
to
36c1cd0
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.
Sorry for the delay. I haven't fully considered the uses of PyEval_GetLocals
. It might better to mark it for removal "in the future" so we can adjust it, rather than being constrained to 3.16.
Python/ceval.c
Outdated
if (PyErr_WarnEx(PyExc_DeprecationWarning, | ||
"PyEval_GetLocals() is deprecated in Python 3.14 " | ||
"and will be removed in 3.16.", 1)) { |
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.
This is the convention for us:
if (PyErr_WarnEx(PyExc_DeprecationWarning, | |
"PyEval_GetLocals() is deprecated in Python 3.14 " | |
"and will be removed in 3.16.", 1)) { | |
if (PyErr_WarnEx(PyExc_DeprecationWarning, | |
"PyEval_GetLocals() is deprecated in Python 3.14 " | |
"and will be removed in 3.16.", 1) < 0) { |
I don't think we ever reached to a conclusion on whether/how/when we deprecate this API. @ncoghlan @markshannon |
0460320
to
0c4e6b5
Compare
0c4e6b5
to
5ace717
Compare
This PR aims to hard deprecate the
PyEval_GetLocals
API by emitting a deprecated warning. Meanwhile, this also removes the corresponding tests for the API.If we consider to deprecate
PyFrame_FastToLocals
andPyFrame_FastToLocalsWithError
as well (mentioned in #125170 (comment)), please let me know. I think they can be done together in this PR.PyEval_GetLocals()
#125170