Author: Matti Picus <matti.pi...@gmail.com>
Branch: 
Changeset: r96270:c035c7de5e39
Date: 2019-03-11 09:12 +0200
http://bitbucket.org/pypy/pypy/changeset/c035c7de5e39/

Log:    fix test

diff --git a/lib_pypy/_ctypes/array.py b/lib_pypy/_ctypes/array.py
--- a/lib_pypy/_ctypes/array.py
+++ b/lib_pypy/_ctypes/array.py
@@ -257,7 +257,7 @@
         try:
             itemsize = struct.calcsize(fmt[1:])
         except:
-            itemsize = len(buffer(obj[0]))
+            itemsize = sizeof(obj[0])
         return __pypy__.newmemoryview(memoryview(self._buffer), itemsize, fmt, 
shape)
 
 ARRAY_CACHE = {}
diff --git a/pypy/module/__pypy__/test/test_newmemoryview.py 
b/pypy/module/__pypy__/test/test_newmemoryview.py
--- a/pypy/module/__pypy__/test/test_newmemoryview.py
+++ b/pypy/module/__pypy__/test/test_newmemoryview.py
@@ -19,7 +19,7 @@
         from __pypy__ import bufferable, newmemoryview
         class B(bufferable.bufferable):
             def __init__(self):
-                self.data = bytearray('abc')
+                self.data = bytearray(b'abc')
 
             def __buffer__(self, flags):
                 return newmemoryview(memoryview(self.data), 1, 'B')
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to