[pypy-commit] pypy py3k: s/buffer/memoryview

antocuni noreply at buildbot.pypy.org
Thu Mar 22 11:26:07 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r53891:b93fdee2d213
Date: 2012-03-22 11:16 +0100
http://bitbucket.org/pypy/pypy/changeset/b93fdee2d213/

Log:	s/buffer/memoryview

diff --git a/pypy/objspace/std/test/test_bytearrayobject.py b/pypy/objspace/std/test/test_bytearrayobject.py
--- a/pypy/objspace/std/test/test_bytearrayobject.py
+++ b/pypy/objspace/std/test/test_bytearrayobject.py
@@ -356,7 +356,7 @@
         b.extend(bytearray(b'def'))
         b.extend(b'ghi')
         assert b == b'abcdefghi'
-        b.extend(buffer(b'jkl'))
+        b.extend(memoryview(b'jkl'))
         assert b == b'abcdefghijkl'
 
         b = bytearray(b'world')
@@ -419,7 +419,7 @@
 
     def test_buffer(self):
         b = bytearray(b'abcdefghi')
-        buf = buffer(b)
+        buf = memoryview(b)
         assert buf[2] == b'c'
         buf[3] = b'D'
         assert b == b'abcDefghi'
diff --git a/pypy/objspace/std/test/test_stringobject.py b/pypy/objspace/std/test/test_stringobject.py
--- a/pypy/objspace/std/test/test_stringobject.py
+++ b/pypy/objspace/std/test/test_stringobject.py
@@ -244,8 +244,8 @@
         assert b'123x123'.replace(b'123', b'') == b'x'
 
     def test_replace_buffer(self):
-        assert b'one'.replace(buffer(b'o'), buffer(b'n'), 1) == b'nne'
-        assert b'one'.replace(buffer(b'o'), buffer(b'n')) == b'nne'
+        assert b'one'.replace(memoryview(b'o'), memoryview(b'n'), 1) == b'nne'
+        assert b'one'.replace(memoryview(b'o'), memoryview(b'n')) == b'nne'
 
     def test_strip(self):
         s = " a b "
@@ -689,7 +689,7 @@
     def test_buffer(self):
         x = b"he"
         x += b"llo"
-        b = buffer(x)
+        b = memoryview(x)
         assert len(b) == 5
         assert b[-1] == b"o"
         assert b[:] == b"hello"


More information about the pypy-commit mailing list