Author: Brian Kearns <bdkea...@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) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit