mirror of https://github.com/python/cpython
On Linux, one sometimes sees spurious errors after interrupting
previous output. Call clearerr() to prevent past errors affecting our ferror() test later, in PyObject_Print(). Suggested by Marc Lemburg.
This commit is contained in:
parent
7b7679eb79
commit
687ef6e70b
|
@ -168,6 +168,7 @@ PyObject_Print(op, fp, flags)
|
|||
return -1;
|
||||
}
|
||||
#endif
|
||||
clearerr(fp); /* Clear any previous error condition */
|
||||
if (op == NULL) {
|
||||
fprintf(fp, "<nil>");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue