[pypy-commit] pypy use-file-star-for-file: group writing ops together

bdkearns noreply at buildbot.pypy.org
Thu Sep 11 12:40:40 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: use-file-star-for-file
Changeset: r73457:67e45cc32904
Date: 2014-09-11 06:25 -0400
http://bitbucket.org/pypy/pypy/changeset/67e45cc32904/

Log:	group writing ops together

diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -524,13 +524,6 @@
         finally:
             rffi.free_nonmovingbuffer(value, ll_value)
 
-    def flush(self):
-        self._check_closed()
-        res = c_fflush(self._ll_file)
-        if res != 0:
-            c_clearerr(self._ll_file)
-            raise _from_errno(IOError)
-
     def truncate(self, arg=-1):
         self._check_closed()
         self._check_writable()
@@ -542,6 +535,13 @@
             c_clearerr(self._ll_file)
             raise _from_errno(IOError)
 
+    def flush(self):
+        self._check_closed()
+        res = c_fflush(self._ll_file)
+        if res != 0:
+            c_clearerr(self._ll_file)
+            raise _from_errno(IOError)
+
     def seek(self, pos, whence=0):
         self._check_closed()
         res = c_fseek(self._ll_file, pos, whence)


More information about the pypy-commit mailing list