Implement the frame evaluation API aspect of PEP 523.

This commit is contained in:
Brett Cannon 2016-09-05 15:33:46 -07:00
parent 625cb379f7
commit 3cebf93872
6 changed files with 47 additions and 3 deletions

View file

@ -796,6 +796,13 @@ PyEval_EvalFrame(PyFrameObject *f) {
PyObject *
PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
{
PyThreadState *tstate = PyThreadState_GET();
return tstate->interp->eval_frame(f, throwflag);
}
PyObject *
_PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
{
#ifdef DXPAIRS
int lastopcode = 0;

View file

@ -91,6 +91,7 @@ PyInterpreterState_New(void)
interp->fscodec_initialized = 0;
interp->importlib = NULL;
interp->import_func = NULL;
interp->eval_frame = _PyEval_EvalFrameDefault;
#ifdef HAVE_DLOPEN
#if HAVE_DECL_RTLD_NOW
interp->dlopenflags = RTLD_NOW;