Author: Ronan Lamy <[email protected]>
Branch: PyBuffer
Changeset: r90850:6395c8c41478
Date: 2017-03-28 18:04 +0100
http://bitbucket.org/pypy/pypy/changeset/6395c8c41478/
Log: Fix BufferSlice.as_str()
diff --git a/pypy/objspace/std/memoryobject.py
b/pypy/objspace/std/memoryobject.py
--- a/pypy/objspace/std/memoryobject.py
+++ b/pypy/objspace/std/memoryobject.py
@@ -738,7 +738,8 @@
return self.shape[0] * self.getitemsize()
def as_str(self):
- return self.getslice(0, self.getlength(), 1, self.getlength())
+ slicelen = self.shape[0]
+ return self.getslice(0, slicelen * self.step, self.step, slicelen)
def as_str_and_offset_maybe(self):
string, offset = self.buf.as_str_and_offset_maybe()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit