mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40421: Add PyFrame_GetCode() function (GH-19757)
PyFrame_GetCode(frame): return a borrowed reference to the frame code. Replace frame->f_code with PyFrame_GetCode(frame) in most code, except in frameobject.c, genobject.c and ceval.c. Also add PyFrame_GetLineNumber() to the limited C API.
This commit is contained in:
parent
b8f704d219
commit
a42ca74fa3
12 changed files with 58 additions and 25 deletions
|
@ -31,6 +31,15 @@ Reflection
|
|||
See also :c:func:`PyThreadState_GetFrame`.
|
||||
|
||||
|
||||
.. c:function:: int PyFrame_GetCode(PyFrameObject *frame)
|
||||
|
||||
Return a borrowed reference to the *frame* code.
|
||||
|
||||
*frame* must not be ``NULL``.
|
||||
|
||||
.. versionadded:: 3.9
|
||||
|
||||
|
||||
.. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame)
|
||||
|
||||
Return the line number that *frame* is currently executing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue