mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Implement the frame evaluation API aspect of PEP 523.
This commit is contained in:
parent
625cb379f7
commit
3cebf93872
6 changed files with 47 additions and 3 deletions
|
@ -12,10 +12,13 @@ extern "C" {
|
|||
|
||||
struct _ts; /* Forward */
|
||||
struct _is; /* Forward */
|
||||
struct _frame; /* Forward declaration for PyFrameObject. */
|
||||
|
||||
#ifdef Py_LIMITED_API
|
||||
typedef struct _is PyInterpreterState;
|
||||
#else
|
||||
typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int);
|
||||
|
||||
typedef struct _is {
|
||||
|
||||
struct _is *next;
|
||||
|
@ -42,14 +45,14 @@ typedef struct _is {
|
|||
|
||||
PyObject *builtins_copy;
|
||||
PyObject *import_func;
|
||||
/* Initialized to PyEval_EvalFrameDefault(). */
|
||||
_PyFrameEvalFunction eval_frame;
|
||||
} PyInterpreterState;
|
||||
#endif
|
||||
|
||||
|
||||
/* State unique per thread */
|
||||
|
||||
struct _frame; /* Avoid including frameobject.h */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
/* Py_tracefunc return -1 when raising an exception, or 0 for success. */
|
||||
typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue