diff options
author | Phillip J. Eby <pje@telecommunity.com> | 2005-08-13 03:29:00 (GMT) |
---|---|---|
committer | Phillip J. Eby <pje@telecommunity.com> | 2005-08-13 03:29:00 (GMT) |
commit | 00148226df1af0f6ef120492c07fb5a8013087fc (patch) | |
tree | a82b14f5304c817a71cfe4807f40482a475c58ca /Objects | |
parent | 038ca2a5516f6b445a8548f3999d1db3b6b8abb1 (diff) | |
download | cpython-00148226df1af0f6ef120492c07fb5a8013087fc.zip cpython-00148226df1af0f6ef120492c07fb5a8013087fc.tar.gz cpython-00148226df1af0f6ef120492c07fb5a8013087fc.tar.bz2 |
Fix a too-aggressive assert (see SF#1257960). Previously, gen_iternext
was never called during interpreter shutdown GC, so the f_back!=NULL
assertion was correct. Now that generators get close()d during GC,
the assertion was being triggered because the generator close() was being
called as the top-level frame. However, nothing actually is broken by
this; it's just that the condition was unexpected in previous Python
versions.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/genobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index d281274..b001b01 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -82,7 +82,7 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc) /* Don't keep the reference to f_back any longer than necessary. It * may keep a chain of frames alive or it could create a reference * cycle. */ - assert(f->f_back != NULL); + assert(f->f_back == tstate->frame); Py_CLEAR(f->f_back); /* If the generator just returned (as opposed to yielding), signal |