[pypy-commit] pypy py3k: buffer no longer exists in py3k, and 'c' is no longer a valid typecode for array.array

antocuni noreply at buildbot.pypy.org
Tue Mar 20 15:52:40 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r53833:34b65bdb71d8
Date: 2012-03-20 15:08 +0100
http://bitbucket.org/pypy/pypy/changeset/34b65bdb71d8/

Log:	buffer no longer exists in py3k, and 'c' is no longer a valid
	typecode for array.array

diff --git a/pypy/module/marshal/test/test_marshalimpl.py b/pypy/module/marshal/test/test_marshalimpl.py
--- a/pypy/module/marshal/test/test_marshalimpl.py
+++ b/pypy/module/marshal/test/test_marshalimpl.py
@@ -23,22 +23,11 @@
         z = marshal.loads(b'I\xd8\xd8\xd9\xda\xdb\xdc\xcd\xfe')
         assert z == -0x0132232425262728
 
-    def test_buffer(self):
-        import marshal
-        z = marshal.loads(buffer(b'i\x02\x00\x00\x00???'))
-        assert z == 2
-
-    def test_marshal_buffer_object(self):
-        import marshal
-        s = marshal.dumps(buffer('foobar'))
-        t = marshal.loads(s)
-        assert type(t) is str and t == 'foobar'
-
     def test_marshal_bufferlike_object(self):
         import marshal, array
-        s = marshal.dumps(array.array('c', 'asd'))
+        s = marshal.dumps(array.array('b', b'asd'))
         t = marshal.loads(s)
-        assert type(t) is str and t == 'asd'
+        assert type(t) is bytes and t == b'asd'
 
     def test_unmarshal_evil_long(self):
         import marshal


More information about the pypy-commit mailing list