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

antocuni noreply at buildbot.pypy.org
Thu Mar 22 11:03:28 CET 2012


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

Log:	s/buffer/memoryview

diff --git a/pypy/module/array/test/test_array.py b/pypy/module/array/test/test_array.py
--- a/pypy/module/array/test/test_array.py
+++ b/pypy/module/array/test/test_array.py
@@ -400,7 +400,7 @@
 
     def test_buffer(self):
         a = self.array('h', b'Hi')
-        buf = buffer(a)
+        buf = memoryview(a)
         assert buf[1] == b'i'
         #raises(TypeError, buf.__setitem__, 1, 'o')
 
diff --git a/pypy/module/bz2/test/test_bz2_compdecomp.py b/pypy/module/bz2/test/test_bz2_compdecomp.py
--- a/pypy/module/bz2/test/test_bz2_compdecomp.py
+++ b/pypy/module/bz2/test/test_bz2_compdecomp.py
@@ -95,7 +95,7 @@
     def test_buffer(self):
         from bz2 import BZ2Compressor
         bz2c = BZ2Compressor()
-        data = bz2c.compress(buffer(self.TEXT))
+        data = bz2c.compress(memoryview(self.TEXT))
         data += bz2c.flush()
         assert self.decompress(data) == self.TEXT
 
@@ -163,7 +163,7 @@
     def test_buffer(self):
         from bz2 import BZ2Decompressor
         bz2d = BZ2Decompressor()
-        decompressed_data = bz2d.decompress(buffer(self.DATA))
+        decompressed_data = bz2d.decompress(memoryview(self.DATA))
         assert decompressed_data == self.TEXT
 
     def test_subsequent_read(self):
@@ -219,6 +219,6 @@
 
     def test_buffer(self):
         import bz2
-        data = bz2.compress(buffer(self.TEXT))
-        result = bz2.decompress(buffer(data))
+        data = bz2.compress(memoryview(self.TEXT))
+        result = bz2.decompress(memoryview(data))
         assert result == self.TEXT


More information about the pypy-commit mailing list