Skip to content
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

Merged
merged 3 commits into from Jul 17, 2022

Conversation

zooba
Copy link
Member

@zooba zooba commented Jul 17, 2022

gh-91348: Restore frame argument to sys._getframe audit event
Update docs (the argument was always there, but previously undocumented)

Update docs (the argument was always there, but previously undocumented)
@@ -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));
Copy link
Contributor

@kumaraditya303 kumaraditya303 Jul 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PyObject *pyFrame = _Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame));
PyObject *pyFrame = Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame));

Copy link
Member Author

@zooba zooba Jul 17, 2022

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.

Copy link
Contributor

@kumaraditya303 kumaraditya303 Jul 17, 2022

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.

zooba and others added 2 commits Jul 17, 2022
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
@zooba
Copy link
Member Author

@zooba zooba commented Jul 17, 2022

I pushed a slightly different change, because we don't particularly care about auditing if the frame can't be found.

Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

LGTM

@zooba zooba merged commit 044a593 into python:main Jul 17, 2022
14 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 17, 2022

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒🤖

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 17, 2022

Sorry @zooba, I had trouble checking out the 3.11 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 044a593cbbe1639e906e06c47504dd1020ddfee4 3.11

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 17, 2022

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒🤖

@zooba zooba deleted the gh91348 branch Jul 17, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 17, 2022
…ythonGH-94928)

(cherry picked from commit 044a593)

Co-authored-by: Steve Dower <steve.dower@python.org>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jul 17, 2022

GH-94932 is a backport of this pull request to the 3.11 branch.

miss-islington added a commit that referenced this issue Jul 17, 2022
(cherry picked from commit 044a593)

Co-authored-by: Steve Dower <steve.dower@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants