mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and frame state (#111648)
This commit is contained in:
parent
7810b6981a
commit
d49aba5a7a
16 changed files with 342 additions and 338 deletions
|
|
@ -608,7 +608,7 @@ static bool frame_is_suspended(PyFrameObject *frame)
|
|||
assert(!_PyFrame_IsIncomplete(frame->f_frame));
|
||||
if (frame->f_frame->owner == FRAME_OWNED_BY_GENERATOR) {
|
||||
PyGenObject *gen = _PyFrame_GetGenerator(frame->f_frame);
|
||||
return gen->gi_frame_state == FRAME_SUSPENDED;
|
||||
return FRAME_STATE_SUSPENDED(gen->gi_frame_state);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue