Author: Matti Picus <[email protected]>
Branch: py3.5
Changeset: r89324:08682b9332c7
Date: 2017-01-02 23:55 +0200
http://bitbucket.org/pypy/pypy/changeset/08682b9332c7/
Log: merge heads
diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py
b/pypy/module/_cffi_backend/test/test_recompiler.py
--- a/pypy/module/_cffi_backend/test/test_recompiler.py
+++ b/pypy/module/_cffi_backend/test/test_recompiler.py
@@ -1975,7 +1975,7 @@
return s;
}
""", packed=True, min_version=(1, 8, 3))
- assert lib.f().y == chr(40)
+ assert ord(lib.f().y) == 40
assert lib.f().x == 200
e = raises(NotImplementedError, lib.g, 0)
assert str(e.value) == (
diff --git a/pypy/module/cpyext/memoryobject.py
b/pypy/module/cpyext/memoryobject.py
--- a/pypy/module/cpyext/memoryobject.py
+++ b/pypy/module/cpyext/memoryobject.py
@@ -213,4 +213,3 @@
# return the obj field of the Py_buffer created by PyMemoryView_GET_BUFFER
# XXX needed for numpy on py3k
raise NotImplementedError('PyMemoryView_GET_BASE')
-
diff --git a/pypy/module/cpyext/test/test_memoryobject.py
b/pypy/module/cpyext/test/test_memoryobject.py
--- a/pypy/module/cpyext/test/test_memoryobject.py
+++ b/pypy/module/cpyext/test/test_memoryobject.py
@@ -5,7 +5,7 @@
from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
from rpython.rlib.buffer import StringBuffer
-only_pypy ="config.option.runappdirect and '__pypy__' not in
sys.builtin_module_names"
+only_pypy ="config.option.runappdirect and '__pypy__' not in
sys.builtin_module_names"
class TestMemoryViewObject(BaseApiTest):
def test_fromobject(self, space, api):
@@ -31,10 +31,10 @@
o = rffi.charp2str(view.c_buf)
assert o == 'hello'
w_mv = api.PyMemoryView_FromBuffer(view)
- for f in ('format', 'itemsize', 'ndim', 'readonly',
+ for f in ('format', 'itemsize', 'ndim', 'readonly',
'shape', 'strides', 'suboffsets'):
w_f = space.wrap(f)
- assert space.eq_w(space.getattr(w_mv, w_f),
+ assert space.eq_w(space.getattr(w_mv, w_f),
space.getattr(w_memoryview, w_f))
class AppTestPyBuffer_FillInfo(AppTestCpythonExtensionBase):
@@ -70,11 +70,6 @@
assert y.shape == (10,)
assert len(y) == 10
assert y[3] == 3
- s = y[3]
- assert len(s) == struct.calcsize('i')
- assert s == struct.pack('i', 3)
- viewlen = module.test_buffer(arr)
- assert viewlen == y.itemsize * len(y)
def test_buffer_protocol_capi(self):
foo = self.import_extension('foo', [
@@ -128,15 +123,15 @@
shape, strides = get_buffer_info(arr, ['C_CONTIGUOUS'])
assert strides[-1] == 8
dt1 = np.dtype(
- [('a', 'b'), ('b', 'i'),
- ('sub0', np.dtype('b,i')),
- ('sub1', np.dtype('b,i')),
- ('sub2', np.dtype('b,i')),
- ('sub3', np.dtype('b,i')),
- ('sub4', np.dtype('b,i')),
- ('sub5', np.dtype('b,i')),
- ('sub6', np.dtype('b,i')),
- ('sub7', np.dtype('b,i')),
+ [('a', 'b'), ('b', 'i'),
+ ('sub0', np.dtype('b,i')),
+ ('sub1', np.dtype('b,i')),
+ ('sub2', np.dtype('b,i')),
+ ('sub3', np.dtype('b,i')),
+ ('sub4', np.dtype('b,i')),
+ ('sub5', np.dtype('b,i')),
+ ('sub6', np.dtype('b,i')),
+ ('sub7', np.dtype('b,i')),
('c', 'i')],
)
x = np.arange(dt1.itemsize, dtype='int8').view(dt1)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit