diff options
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 1c3a610..3e0c76a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -532,7 +532,11 @@ eval_code(co, globals, locals, arg) char *s = getstringvalue(v); int len = getstringsize(v); fwrite(s, 1, len, fp); - if (len > 0 && s[len-1] == '\n') + if (ferror(fp)) { + err_errno(IOError); + err = -1; + } + else if (len > 0 && s[len-1] == '\n') softspace(sysget("stdout"), 0); } else { |