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:
Guido van Rossum 2000-01-12 16:28:58 +00:00
parent 7b7679eb79
commit 687ef6e70b
1 changed files with 1 additions and 0 deletions

View File

@ -168,6 +168,7 @@ PyObject_Print(op, fp, flags)
return -1; return -1;
} }
#endif #endif
clearerr(fp); /* Clear any previous error condition */
if (op == NULL) { if (op == NULL) {
fprintf(fp, "<nil>"); fprintf(fp, "<nil>");
} }