未验证 提交 2951521a 编写于 作者: N Nyakku Shigure 提交者: GitHub

[SOT] eval frame skipping the generator in python 3.11 (#56262)

Co-authored-by: Nxiongkun <xiongkun03@baidu.com>
上级 100ac296
......@@ -206,6 +206,9 @@ static PyObject *_custom_eval_frame(PyThreadState *tstate,
// _PyFrame_GetFrameObject(frame) # this function should be the right answer,
// but nm libpython.so | grep _PyFrame_MakeAndSetFrameObject is a `t' symbol,
// which means it's local to library. we will get a link error if we use it.
if (frame->owner == FRAME_OWNED_BY_GENERATOR) {
return eval_frame_default(tstate, frame, throw_flag);
}
if (PyFrame_FastToLocalsWithError(Paddle_PyFrame_GetFrameObject(frame)) < 0) {
#else
if (PyFrame_FastToLocalsWithError(frame) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册