[Python-checkins] python/dist/src/Objects genobject.c,1.5,1.6

pje@users.sourceforge.net pje at users.sourceforge.net
Sat Aug 13 05:29:09 CEST 2005


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12609/Objects

Modified Files:
	genobject.c 
Log Message:
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.


Index: genobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/genobject.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- genobject.c	2 Aug 2005 00:46:45 -0000	1.5
+++ genobject.c	13 Aug 2005 03:29:00 -0000	1.6
@@ -82,7 +82,7 @@
 	/* 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



More information about the Python-checkins mailing list