mirror of
https://github.com/python/cpython.git
synced 2025-12-31 12:33:28 +00:00
[3.13] GH-100964: Fix reference cycle in exhausted generator frames (G… (#142904)
* [3.13] GH-100964: Fix reference cycle in exhausted generator frames (GH-141112)
(cherry picked from commit 92243dc62c)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
This commit is contained in:
parent
db552ddb1e
commit
8f7c4f1cef
3 changed files with 14 additions and 1 deletions
|
|
@ -1696,10 +1696,10 @@ clear_gen_frame(PyThreadState *tstate, _PyInterpreterFrame * frame)
|
|||
gen->gi_exc_state.previous_item = NULL;
|
||||
tstate->c_recursion_remaining--;
|
||||
assert(frame->frame_obj == NULL || frame->frame_obj->f_frame == frame);
|
||||
frame->previous = NULL;
|
||||
_PyFrame_ClearExceptCode(frame);
|
||||
_PyErr_ClearExcState(&gen->gi_exc_state);
|
||||
tstate->c_recursion_remaining++;
|
||||
frame->previous = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue