mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
Add a comment about incref'ing w.
This commit is contained in:
parent
3214a01d27
commit
aa76d77e2b
1 changed files with 2 additions and 0 deletions
|
@ -1617,6 +1617,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
"lost sys.stdout");
|
"lost sys.stdout");
|
||||||
}
|
}
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
|
/* w.write() may replace sys.stdout, so we
|
||||||
|
* have to keep our reference to it */
|
||||||
Py_INCREF(w);
|
Py_INCREF(w);
|
||||||
err = PyFile_WriteString("\n", w);
|
err = PyFile_WriteString("\n", w);
|
||||||
if (err == 0)
|
if (err == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue