Author: Matti Picus <[email protected]>
Branch: buffer-interface2
Changeset: r87118:5b04c1bb7084
Date: 2016-09-15 07:36 +0300
http://bitbucket.org/pypy/pypy/changeset/5b04c1bb7084/
Log: failing test
is the decode (which is not the core of the test) valid on other
platforms?
diff --git a/pypy/module/cpyext/test/test_arraymodule.py
b/pypy/module/cpyext/test/test_arraymodule.py
--- a/pypy/module/cpyext/test/test_arraymodule.py
+++ b/pypy/module/cpyext/test/test_arraymodule.py
@@ -100,3 +100,10 @@
val = module.readbuffer_as_string(arr)
assert val == struct.pack('i', 2)
+
+ def test_unicode_readbuffer(self):
+ # Not really part of array, refactor
+ import struct
+ module = self.import_module(name='array')
+ val = module.readbuffer_as_string(u'\u03a3')
+ assert val.decode('utf32') == u'\u03a3'
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -785,6 +785,7 @@
pto.c_tp_getattro = base.c_tp_getattro
if not pto.c_tp_as_buffer:
pto.c_tp_as_buffer = base.c_tp_as_buffer
+ # XXX need to refactor: what about built-in objects i.e. W_Unicode
if base.c_tp_as_buffer:
# also inherit all the base.c_tp_as_buffer functions, since they
# do not have real __slots__ they are not filled in otherwise
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit