On Linux, one sometimes sees spurious errors after interrupting
authorGuido van Rossum <guido@python.org>
Wed, 12 Jan 2000 16:28:58 +0000 (16:28 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 12 Jan 2000 16:28:58 +0000 (16:28 +0000)
previous output.  Call clearerr() to prevent past errors affecting our
ferror() test later, in PyObject_Print().  Suggested by Marc Lemburg.

Objects/object.c

index b62477a812f35300f8801810e426ea90a0265a44..ee9c27146b2adf88ae02bac38bbfdadf62e2c9df 100644 (file)
@@ -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>");
        }