[pypy-commit] pypy streamio-bufinput: got rid of the strange whence=2 code for when a MyNotImplementedError is raised. tests all still pass.
justinpeel
noreply at buildbot.pypy.org
Sat Aug 20 17:49:37 CEST 2011
Author: Justin Peel <notmuchtotell at gmail.com>
Branch: streamio-bufinput
Changeset: r46668:0a9f3a17a71d
Date: 2011-08-20 09:53 -0600
http://bitbucket.org/pypy/pypy/changeset/0a9f3a17a71d/
Log: got rid of the strange whence=2 code for when a
MyNotImplementedError is raised. tests all still pass.
diff --git a/pypy/rlib/streamio.py b/pypy/rlib/streamio.py
--- a/pypy/rlib/streamio.py
+++ b/pypy/rlib/streamio.py
@@ -551,42 +551,6 @@
self.pos = 0
self.buf = ""
return
- # We'll comment all of this for now unless someone really wants
- # something like it
- #try:
- # self.do_seek(offset, 2)
- #except MyNotImplementedError:
- # pass
- #else:
- # self.pos = 0
- # self.buf = ""
- # return
- # Skip relative to EOF by reading and saving only just as
- # much as needed
- #intoffset = offset2int(offset)
- #self.lines.reverse()
- #data = "\n".join(self.lines + [self.buf])
- #total = len(data)
- #buffers = [data]
- #self.lines = []
- #self.buf = ""
- #while 1:
- #data = self.do_read(self.bufsize)
- #if not data:
- #break
- #buffers.append(data)
- #total += len(data)
- #while buffers and total >= len(buffers[0]) - intoffset:
- #total -= len(buffers[0])
- #del buffers[0]
- #cutoff = total + intoffset
- #if cutoff < 0:
- #raise StreamError("cannot seek back")
- #if buffers:
- #buffers[0] = buffers[0][cutoff:]
- #self.buf = "".join(buffers)
- #self.lines = []
- #return
raise StreamError("whence should be 0, 1 or 2")
def readall(self):
More information about the pypy-commit
mailing list