]> granicus.if.org Git - python/commitdiff
Add a comment about incref'ing w.
authorGeorg Brandl <georg@python.org>
Tue, 1 Jul 2008 20:56:03 +0000 (20:56 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 1 Jul 2008 20:56:03 +0000 (20:56 +0000)
Python/ceval.c

index 60a91b2759c574d82db22a21a659f6c6ef37ed84..037c86c134a40e56a205939bfb134645bc8c40e0 100644 (file)
@@ -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)