Author: Manuel Jacob <[email protected]>
Branch: py3.3
Changeset: r76177:00ae8705f679
Date: 2015-02-27 16:59 +0100
http://bitbucket.org/pypy/pypy/changeset/00ae8705f679/
Log: Let _rawffi.Array make use of the extended internal buffer API.
diff --git a/pypy/module/_rawffi/array.py b/pypy/module/_rawffi/array.py
--- a/pypy/module/_rawffi/array.py
+++ b/pypy/module/_rawffi/array.py
@@ -198,6 +198,10 @@
for i in range(len(value)):
ll_buffer[start + i] = value[i]
+ def buffer_w_ex(self, space, flags):
+ return self.buffer_w(space, flags), self.shape.itemcode,
self.shape.size
+
+
W_ArrayInstance.typedef = TypeDef(
'ArrayInstance',
__repr__ = interp2app(W_ArrayInstance.descr_repr),
diff --git a/pypy/module/_rawffi/test/test__rawffi.py
b/pypy/module/_rawffi/test/test__rawffi.py
--- a/pypy/module/_rawffi/test/test__rawffi.py
+++ b/pypy/module/_rawffi/test/test__rawffi.py
@@ -1115,7 +1115,7 @@
s = S(autofree=True)
b = memoryview(s)
assert len(b) == 40
- b[4] = b'X'
+ b[4] = ord(b'X')
b[:3] = b'ABC'
assert b[:6] == b'ABC\x00X\x00'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit