diff options
author | Brett Cannon <brett@python.org> | 2016-09-05 22:33:46 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-09-05 22:33:46 (GMT) |
commit | 3cebf9387279d8b21369f55e205392199ad9b1a2 (patch) | |
tree | 3ab40b5c47ee4876a46d2ca6920b402a0e63cd16 /Python | |
parent | 625cb379f7e77457ca5be94e175d4b71a1d8989f (diff) | |
download | cpython-3cebf9387279d8b21369f55e205392199ad9b1a2.zip cpython-3cebf9387279d8b21369f55e205392199ad9b1a2.tar.gz cpython-3cebf9387279d8b21369f55e205392199ad9b1a2.tar.bz2 |
Implement the frame evaluation API aspect of PEP 523.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 7 | ||||
-rw-r--r-- | Python/pystate.c | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 5a542f0..05563a0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -797,6 +797,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; #endif diff --git a/Python/pystate.c b/Python/pystate.c index 25110b2..61bda2a 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -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; |