Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 687ef6e

Browse files
committed
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.
1 parent 7b7679e commit 687ef6e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Objects/object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ PyObject_Print(op, fp, flags)
168168
return -1;
169169
}
170170
#endif
171+
clearerr(fp); /* Clear any previous error condition */
171172
if (op == NULL) {
172173
fprintf(fp, "<nil>");
173174
}

0 commit comments

Comments
 (0)