Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-96803: Document and test new unstable internal frame API functions #104211

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

Merged
merged 9 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Weaken contract of PyUnstable_InterpreterFrame_GetCode to return PyOb…
…ject*.
  • Loading branch information
markshannon committed May 5, 2023
commit c144a623edeb62dd953779ca5b7f97768d2fe660
2 changes: 1 addition & 1 deletion 2 Doc/c-api/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Unless using PEP 523, you will not need this.
The interpreter's internal frame representation.

markshannon marked this conversation as resolved.
Show resolved Hide resolved

.. c:function:: PyCodeObject* PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);
.. c:function:: PyObject* PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);

Return a :term:`strong reference` to the code object for the frame.

Expand Down
2 changes: 1 addition & 1 deletion 2 Include/cpython/frameobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);

/* Returns the code object of the frame (strong reference).
* Does not raise an exception. */
PyAPI_FUNC(PyCodeObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);
PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);

/* Returns a byte ofsset into the last executed instruction.
* Does not raise an exception. */
Expand Down
4 changes: 2 additions & 2 deletions 4 Python/frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ _PyFrame_ClearExceptCode(_PyInterpreterFrame *frame)

/* Unstable API functions */

PyCodeObject *
PyObject *
PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame)
{
PyCodeObject *code = frame->f_code;
PyObject *code = (PyObject *)frame->f_code;
Py_INCREF(code);
return code;
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.