[pypy-commit] pypy use-file-star-for-file: use explicit asserts here
bdkearns
noreply at buildbot.pypy.org
Wed Sep 17 01:30:47 CEST 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch: use-file-star-for-file
Changeset: r73570:27bcb64887c4
Date: 2014-09-16 17:49 -0400
http://bitbucket.org/pypy/pypy/changeset/27bcb64887c4/
Log: use explicit asserts here
diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -429,7 +429,7 @@
raise _from_errno(IOError)
elif chunksize == size:
# we read everything in one call, try to avoid copy
- # (remainsize == size if chunksize == size)
+ assert remainsize == size
return rffi.str_from_buffer(raw_buf, gc_buf, remainsize, size)
s.append_charpsize(raw_buf, chunksize)
if chunksize < remainsize and not interrupted:
@@ -568,7 +568,7 @@
self._skipnextlf = skipnextlf
if i == size:
# we read everything in one call, try to avoid copy
- # (remainsize == size if i == size)
+ assert remainsize == size
return rffi.str_from_buffer(raw_buf, gc_buf, remainsize, size)
s.append_charpsize(raw_buf, i)
if c == ord('\n'):
More information about the pypy-commit
mailing list