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

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


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

Log:	s/buffer/memoryview

diff --git a/pypy/module/fcntl/test/test_fcntl.py b/pypy/module/fcntl/test/test_fcntl.py
--- a/pypy/module/fcntl/test/test_fcntl.py
+++ b/pypy/module/fcntl/test/test_fcntl.py
@@ -33,7 +33,7 @@
         raises((IOError, ValueError), fcntl.fcntl, -1, 1, 0)
         assert fcntl.fcntl(f, 1, 0) == 0
         assert fcntl.fcntl(f, 2, "foo") == b"foo"
-        assert fcntl.fcntl(f, 2, buffer(b"foo")) == b"foo"
+        assert fcntl.fcntl(f, 2, memoryview(b"foo")) == b"foo"
 
         try:
             os.O_LARGEFILE
diff --git a/pypy/module/zlib/test/test_zlib.py b/pypy/module/zlib/test/test_zlib.py
--- a/pypy/module/zlib/test/test_zlib.py
+++ b/pypy/module/zlib/test/test_zlib.py
@@ -215,21 +215,21 @@
         """
         We should be able to pass buffer objects instead of strings.
         """
-        assert self.zlib.crc32(buffer(b'hello, world.')) == -936931198
-        assert self.zlib.adler32(buffer(b'hello, world.')) == 571147447
+        assert self.zlib.crc32(memoryview(b'hello, world.')) == -936931198
+        assert self.zlib.adler32(memoryview(b'hello, world.')) == 571147447
 
         compressor = self.zlib.compressobj()
-        bytes = compressor.compress(buffer(self.expanded))
+        bytes = compressor.compress(memoryview(self.expanded))
         bytes += compressor.flush()
         assert bytes == self.compressed
 
         decompressor = self.zlib.decompressobj()
-        bytes = decompressor.decompress(buffer(self.compressed))
+        bytes = decompressor.decompress(memoryview(self.compressed))
         bytes += decompressor.flush()
         assert bytes == self.expanded
 
-        bytes = self.zlib.compress(buffer(self.expanded))
+        bytes = self.zlib.compress(memoryview(self.expanded))
         assert bytes == self.compressed
 
-        bytes = self.zlib.decompress(buffer(self.compressed))
+        bytes = self.zlib.decompress(memoryview(self.compressed))
         assert bytes == self.expanded


More information about the pypy-commit mailing list