mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
GH-100964: Break cycles involving exception state when returning from generator (GH-107563)
This commit is contained in:
parent
dd693d6320
commit
0d30a5a409
3 changed files with 7 additions and 5 deletions
|
@ -1466,6 +1466,7 @@ clear_gen_frame(PyThreadState *tstate, _PyInterpreterFrame * frame)
|
|||
tstate->c_recursion_remaining--;
|
||||
assert(frame->frame_obj == NULL || frame->frame_obj->f_frame == frame);
|
||||
_PyFrame_ClearExceptCode(frame);
|
||||
_PyErr_ClearExcState(&gen->gi_exc_state);
|
||||
tstate->c_recursion_remaining++;
|
||||
frame->previous = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue