Author: Matti Picus <[email protected]>
Branch: memoryview-attributes
Changeset: r86434:f3bd9cd817f0
Date: 2016-08-23 16:34 +1000
http://bitbucket.org/pypy/pypy/changeset/f3bd9cd817f0/
Log: revert to original return value
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -464,8 +464,11 @@
"Cannot use string as modifiable buffer")
def descr_getbuffer(self, space, w_flags):
- from pypy.objspace.std.bufferobject import W_Buffer
- return W_Buffer(StringBuffer(self._value))
+ #from pypy.objspace.std.bufferobject import W_Buffer
+ #return W_Buffer(StringBuffer(self._value))
+ # XXX handle flags, figure out why returning a W_Buffer
+ # makes upstream ctypes tests fail
+ return self
charbuf_w = str_w
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
@@ -127,7 +127,7 @@
return space.wrap(self.buf.getndim())
def w_is_readonly(self, space):
- return space.newbool(self.buf.readonly != 0)
+ return space.newbool(bool(self.buf.readonly))
def w_get_shape(self, space):
return space.newtuple([space.wrap(x) for x in self.buf.getshape()])
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit