Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-141518: Add PyUnstable_InterpreterFrame_GetFrameObject() function#141950
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
58ac3143e6cc65d02c52410410171d8d314559096cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -23,18 +23,26 @@ PyAPI_FUNC(PyObject*) PyFrame_GetVarString(PyFrameObject *frame, const char *nam | ||
| * implementing custom frame evaluators with PEP 523. */ | ||
| struct _PyInterpreterFrame; | ||
| typedef struct _PyInterpreterFrame PyUnstable_InterpreterFrame; | ||
| /* Returns the code object of the frame (strong reference). | ||
| * Does not raise an exception. */ | ||
| PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame); | ||
| PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode( | ||
| PyUnstable_InterpreterFrame *frame); | ||
| /* Returns a byte offset into the last executed instruction. | ||
| * Does not raise an exception. */ | ||
| PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame); | ||
| PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti( | ||
| PyUnstable_InterpreterFrame *frame); | ||
| /* Returns the currently executing line number, or -1 if there is no line number. | ||
| * Does not raise an exception. */ | ||
| PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame); | ||
| PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine( | ||
| PyUnstable_InterpreterFrame *frame); | ||
vstinner marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| /* Get a frame object from an interpreter frame. */ | ||
| PyAPI_FUNC(PyFrameObject*) PyUnstable_InterpreterFrame_GetFrameObject( | ||
| PyUnstable_InterpreterFrame *frame); | ||
| #define PyUnstable_EXECUTABLE_KIND_SKIP 0 | ||
| #define PyUnstable_EXECUTABLE_KIND_PY_FUNCTION 1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Add :c:func:`PyUnstable_InterpreterFrame_GetFrameObject` to get a frame | ||
| object from an interpreter frame. Patch by Victor Stinner. | ||
efimov-mikhail marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2457,3 +2457,10 @@ PyFrame_GetGenerator(PyFrameObject *frame) | ||
| assert(!_PyFrame_IsIncomplete(frame->f_frame)); | ||
| return frame_generator_get((PyObject *)frame, NULL); | ||
| } | ||
efimov-mikhail marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| PyFrameObject* | ||
| PyUnstable_InterpreterFrame_GetFrameObject(PyUnstable_InterpreterFrame *frame) | ||
| { | ||
| return (PyFrameObject*)Py_XNewRef(_PyFrame_GetFrameObject(frame)); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.