Author: Matti Picus <matti.pi...@gmail.com>
Branch: 
Changeset: r97186:d087a60ceaaf
Date: 2019-08-15 18:13 +0300
http://bitbucket.org/pypy/pypy/changeset/d087a60ceaaf/

Log:    qualify memoryview.cast to python 3.3 and up

diff --git a/extra_tests/ctypes_tests/test_cast.py 
b/extra_tests/ctypes_tests/test_cast.py
--- a/extra_tests/ctypes_tests/test_cast.py
+++ b/extra_tests/ctypes_tests/test_cast.py
@@ -30,9 +30,11 @@
     assert x.value is True
 
 def test_cast_array():
+    import sys
     data = b'data'
     ubyte = c_ubyte * len(data)
     byteslike = ubyte.from_buffer_copy(data)
     m = memoryview(byteslike)
-    b = m.cast('B')
-    assert bytes(b) == data
+    if sys.version_info > (3, 3):
+        b = m.cast('B')
+        assert bytes(b) == data
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to