mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
GH-96803: Add three C-API functions to make _PyInterpreterFrame less opaque for users of PEP 523. (GH-96849)
This commit is contained in:
parent
45a9e3834a
commit
a0df9ee8fc
9 changed files with 48 additions and 8 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "pycore_pystate.h" // _PyThreadState_GET()
|
||||
#include "structmember.h" // PyMemberDef
|
||||
#include "opcode.h" // SEND
|
||||
#include "frameobject.h" // _PyInterpreterFrame_GetLine
|
||||
#include "pystats.h"
|
||||
|
||||
static PyObject *gen_close(PyGenObject *, PyObject *);
|
||||
|
@ -1322,7 +1323,7 @@ compute_cr_origin(int origin_depth, _PyInterpreterFrame *current_frame)
|
|||
frame = current_frame;
|
||||
for (int i = 0; i < frame_count; ++i) {
|
||||
PyCodeObject *code = frame->f_code;
|
||||
int line = _PyInterpreterFrame_GetLine(frame);
|
||||
int line = PyUnstable_InterpreterFrame_GetLine(frame);
|
||||
PyObject *frameinfo = Py_BuildValue("OiO", code->co_filename, line,
|
||||
code->co_name);
|
||||
if (!frameinfo) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue