Author: Ronan Lamy <ronan.l...@gmail.com> Branch: PyBuffer Changeset: r91041:4d42369e2fb3 Date: 2017-04-11 18:40 +0100 http://bitbucket.org/pypy/pypy/changeset/4d42369e2fb3/
Log: Fix tolist() on 1-D buffers 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 @@ -104,8 +104,9 @@ raise NotImplementedError elif dim == 1: itemsize = self.getitemsize() - return self._tolist(space, buf.as_binary(), self.getlength(), itemsize, fmt, - self.getstrides()) + n = self.getshape()[0] + values_w = [buf.w_getitem(space, i) for i in range(n)] + return space.newlist(values_w) else: return self._tolist_rec(space, buf.as_binary(), 0, 0, fmt) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit