mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Restore PEP 523 functionality. (GH-28871)
This commit is contained in:
parent
9883ca498d
commit
fcb3d2ff63
3 changed files with 15 additions and 6 deletions
|
|
@ -230,7 +230,7 @@ PyInterpreterState_New(void)
|
|||
PyConfig_InitPythonConfig(&interp->config);
|
||||
_PyType_InitCache(interp);
|
||||
|
||||
interp->eval_frame = _PyEval_EvalFrameDefault;
|
||||
interp->eval_frame = NULL;
|
||||
#ifdef HAVE_DLOPEN
|
||||
#if HAVE_DECL_RTLD_NOW
|
||||
interp->dlopenflags = RTLD_NOW;
|
||||
|
|
@ -1973,6 +1973,9 @@ _register_builtins_for_crossinterpreter_data(struct _xidregistry *xidregistry)
|
|||
_PyFrameEvalFunction
|
||||
_PyInterpreterState_GetEvalFrameFunc(PyInterpreterState *interp)
|
||||
{
|
||||
if (interp->eval_frame == NULL) {
|
||||
return _PyEval_EvalFrameDefault;
|
||||
}
|
||||
return interp->eval_frame;
|
||||
}
|
||||
|
||||
|
|
@ -1981,7 +1984,12 @@ void
|
|||
_PyInterpreterState_SetEvalFrameFunc(PyInterpreterState *interp,
|
||||
_PyFrameEvalFunction eval_frame)
|
||||
{
|
||||
interp->eval_frame = eval_frame;
|
||||
if (eval_frame == _PyEval_EvalFrameDefault) {
|
||||
interp->eval_frame = NULL;
|
||||
}
|
||||
else {
|
||||
interp->eval_frame = eval_frame;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue