Author: Ronan Lamy <[email protected]>
Branch: PyBuffer
Changeset: r91109:015c3a23c327
Date: 2017-04-21 04:24 +0100
http://bitbucket.org/pypy/pypy/changeset/015c3a23c327/

Log:    fix translation

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
@@ -166,10 +166,11 @@
             raise TypeError("memoryview: invalid slice key")
 
     def new_slice(self, start, stop, step, slicelength, dim):
-        if step == 1 and isinstance(self.buf, SimpleBuffer):
-            sliced = SimpleBuffer(SubBuffer(self.buf.data, start, slicelength))
+        pybuf = self.buf
+        if step == 1 and isinstance(pybuf, SimpleBuffer):
+            sliced = SimpleBuffer(SubBuffer(pybuf.data, start, slicelength))
         else:
-            sliced = BufferSlice(self.buf, start, step, slicelength)
+            sliced = BufferSlice(pybuf, start, step, slicelength)
         return W_MemoryView(sliced)
 
     def init_len(self):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to