Author: Brian Kearns <[email protected]>
Branch: use-file-star-for-file
Changeset: r73445:a337ec6aba73
Date: 2014-09-11 01:14 -0400
http://bitbucket.org/pypy/pypy/changeset/a337ec6aba73/

Log:    try to fix test_write_full

diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -468,9 +468,9 @@
         try:
             # note that since we got a nonmoving buffer, it is either raw
             # or already cannot move, so the arithmetics below are fine
-            length = len(value)
-            bytes = c_fwrite(ll_value, 1, length, self._ll_file)
-            if bytes != length:
+            n = len(value)
+            n2 = c_fwrite(ll_value, 1, n, self._ll_file)
+            if n2 != n or c_ferror(self._ll_file):
                 errno = rposix.get_errno()
                 c_clearerr(self._ll_file)
                 raise IOError(errno, os.strerror(errno))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to