diff Python/ceval.c @ 47868:4a8329535234 legacy-trunk

Add a comment about incref'ing w.
author Georg Brandl <georg@python.org>
date Tue, 01 Jul 2008 20:56:03 +0000
parents 7dbd6b607706
children c93596ec1d3d
line wrap: on
line diff
--- a/Python/ceval.c	Tue Jul 01 20:50:02 2008 +0000
+++ b/Python/ceval.c	Tue Jul 01 20:56:03 2008 +0000
@@ -1617,6 +1617,8 @@
 							"lost sys.stdout");
 			}
 			if (w != NULL) {
+				/* w.write() may replace sys.stdout, so we
+				 * have to keep our reference to it */
 				Py_INCREF(w);
 				err = PyFile_WriteString("\n", w);
 				if (err == 0)