summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-01-12 16:28:58 (GMT)
committerGuido van Rossum <guido@python.org>2000-01-12 16:28:58 (GMT)
commit687ef6e70bf17f33d8fe0635dabb32ccc4cf4133 (patch)
tree896eeaebe7699e4b54e6fc7636f41110e117005e /Objects
parent7b7679eb79a7ad7766881b05fab0681850f79a6f (diff)
downloadcpython-687ef6e70bf17f33d8fe0635dabb32ccc4cf4133.zip
cpython-687ef6e70bf17f33d8fe0635dabb32ccc4cf4133.tar.gz
cpython-687ef6e70bf17f33d8fe0635dabb32ccc4cf4133.tar.bz2
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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index b62477a..ee9c271 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -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>");
}