mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45813: Drop redundant assertion from frame.clear() (GH-29990)
* bpo-45813: Drop redundant assertion from frame.clear() * Move assertion to frame_dealloc()
This commit is contained in:
parent
69806b9516
commit
d4363d2140
2 changed files with 15 additions and 3 deletions
|
@ -613,6 +613,10 @@ static PyGetSetDef frame_getsetlist[] = {
|
|||
static void
|
||||
frame_dealloc(PyFrameObject *f)
|
||||
{
|
||||
/* It is the responsibility of the owning generator/coroutine
|
||||
* to have cleared the generator pointer */
|
||||
assert(f->f_frame->generator == NULL);
|
||||
|
||||
if (_PyObject_GC_IS_TRACKED(f)) {
|
||||
_PyObject_GC_UNTRACK(f);
|
||||
}
|
||||
|
@ -686,7 +690,6 @@ frame_clear(PyFrameObject *f, PyObject *Py_UNUSED(ignored))
|
|||
}
|
||||
if (f->f_frame->generator) {
|
||||
_PyGen_Finalize(f->f_frame->generator);
|
||||
assert(f->f_frame->generator == NULL);
|
||||
}
|
||||
(void)frame_tp_clear(f);
|
||||
Py_RETURN_NONE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue