-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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-91348: Restore frame argument to sys._getframe audit event #94928
Conversation
Update docs (the argument was always there, but previously undocumented)
Python/sysmodule.c
Outdated
@@ -1793,7 +1789,13 @@ sys__getframe_impl(PyObject *module, int depth) | |||
"call stack is not deep enough"); | |||
return NULL; | |||
} | |||
return _Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame)); | |||
|
|||
PyObject *pyFrame = _Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame)); |
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.
PyObject *pyFrame = _Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame)); | |
PyObject *pyFrame = Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame)); |
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 this wasn't changed here when the public name was added? This line wasn't my change.
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.
Seems like an oversight Py_XNewRef
is just an alias for _Py_XNewRef
but without underscore looks better. Either way is fine.
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
I pushed a slightly different change, because we don't particularly care about auditing if the frame can't be found. |
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 @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry @zooba, I had trouble checking out the |
Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…ythonGH-94928) (cherry picked from commit 044a593) Co-authored-by: Steve Dower <steve.dower@python.org>
GH-94932 is a backport of this pull request to the 3.11 branch. |
gh-91348: Restore frame argument to sys._getframe audit event
Update docs (the argument was always there, but previously undocumented)