Skip to content

Commit 89ff7bd

Browse files
vstinnermiss-islington
authored andcommitted
pythonGH-96803: Move PyUnstable_InterpreterFrame_GetCode() to Python.h (pythonGH-107188)
Declare the following 3 PyUnstable functions in Include/cpython/pyframe.h rather than Include/cpython/frameobject.h, so they are now provided by the standard "GH-include <Python.h>". (cherry picked from commit 837fa5c) Co-authored-by: Victor Stinner <[email protected]>
1 parent 69d4e8c commit 89ff7bd

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Include/cpython/frameobject.h

-17
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# error "this header file must not be included directly"
55
#endif
66

7-
struct _PyInterpreterFrame;
8-
97
/* Standard object interface */
108

119
PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
@@ -29,18 +27,3 @@ PyAPI_FUNC(int) _PyFrame_IsEntryFrame(PyFrameObject *frame);
2927

3028
PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f);
3129
PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
32-
33-
/* The following functions are for use by debuggers and other tools
34-
* implementing custom frame evaluators with PEP 523. */
35-
36-
/* Returns the code object of the frame (strong reference).
37-
* Does not raise an exception. */
38-
PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);
39-
40-
/* Returns a byte ofsset into the last executed instruction.
41-
* Does not raise an exception. */
42-
PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame);
43-
44-
/* Returns the currently executing line number, or -1 if there is no line number.
45-
* Does not raise an exception. */
46-
PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame);

Include/cpython/pyframe.h

+17
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,20 @@ PyAPI_FUNC(PyObject *) PyFrame_GetGenerator(PyFrameObject *frame);
1616
PyAPI_FUNC(int) PyFrame_GetLasti(PyFrameObject *frame);
1717
PyAPI_FUNC(PyObject*) PyFrame_GetVar(PyFrameObject *frame, PyObject *name);
1818
PyAPI_FUNC(PyObject*) PyFrame_GetVarString(PyFrameObject *frame, const char *name);
19+
20+
/* The following functions are for use by debuggers and other tools
21+
* implementing custom frame evaluators with PEP 523. */
22+
23+
struct _PyInterpreterFrame;
24+
25+
/* Returns the code object of the frame (strong reference).
26+
* Does not raise an exception. */
27+
PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);
28+
29+
/* Returns a byte ofsset into the last executed instruction.
30+
* Does not raise an exception. */
31+
PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame);
32+
33+
/* Returns the currently executing line number, or -1 if there is no line number.
34+
* Does not raise an exception. */
35+
PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame);

0 commit comments

Comments
 (0)