Author: Ronan Lamy <[email protected]>
Branch: py3k
Changeset: r86792:76de024304d4
Date: 2016-08-31 20:10 +0100
http://bitbucket.org/pypy/pypy/changeset/76de024304d4/

Log:    fix memoryview(<ctypes.Structure>)

diff --git a/lib_pypy/_ctypes/basics.py b/lib_pypy/_ctypes/basics.py
--- a/lib_pypy/_ctypes/basics.py
+++ b/lib_pypy/_ctypes/basics.py
@@ -167,7 +167,7 @@
             return self.value
 
     def __buffer__(self, flags):
-        return buffer(self._buffer)
+        return memoryview(self._buffer)
 
     def _get_b_base(self):
         try:
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -237,7 +237,8 @@
     def _buffer(self, space, flags):
         w_impl = space.lookup(self, '__buffer__')
         if w_impl is not None:
-            w_result = space.get_and_call_function(w_impl, self)
+            w_result = space.get_and_call_function(w_impl, self,
+                                                   space.newint(flags))
             if space.isinstance_w(w_result, space.w_memoryview):
                 return w_result
         raise BufferInterfaceNotFound
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to