From: Georg Brandl Date: Tue, 1 Jul 2008 20:56:03 +0000 (+0000) Subject: Add a comment about incref'ing w. X-Git-Tag: v2.6b2~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa76d77e2b49c134f31f56b6192d600a43ffcecf;p=python Add a comment about incref'ing w. --- diff --git a/Python/ceval.c b/Python/ceval.c index 60a91b2759..037c86c134 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1617,6 +1617,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) "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)