From aa76d77e2b49c134f31f56b6192d600a43ffcecf Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 1 Jul 2008 20:56:03 +0000 Subject: Add a comment about incref'ing w. --- Python/ceval.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/ceval.c b/Python/ceval.c index 60a91b2..037c86c 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) -- cgit v0.12