[pypy-commit] pypy default: corner corner case, gives a slightly less bogus result

arigo noreply at buildbot.pypy.org
Mon Oct 13 19:45:14 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r73923:85646d1d07fb
Date: 2014-10-13 19:33 +0200
http://bitbucket.org/pypy/pypy/changeset/85646d1d07fb/

Log:	corner corner case, gives a slightly less bogus result

diff --git a/rpython/rlib/streamio.py b/rpython/rlib/streamio.py
--- a/rpython/rlib/streamio.py
+++ b/rpython/rlib/streamio.py
@@ -580,11 +580,11 @@
         # But it won't depend on either on a relative forward seek.
         # Nor on a seek to the very end.
         if whence == 0 or whence == 1:
-            currentsize = len(self.buf) - self.pos
             if whence == 0:
-                difpos = offset - self.tell()
+                difpos = offset - self.tell()   # may clean up self.buf/self.pos
             else:
                 difpos = offset
+            currentsize = len(self.buf) - self.pos
             if -self.pos <= difpos <= currentsize:
                 self.pos += intmask(difpos)
                 return


More information about the pypy-commit mailing list