[pypy-commit] pypy default: fix for test_file

arigo pypy.commits at gmail.com
Sat Apr 16 11:54:19 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r83703:c967ca439384
Date: 2016-04-16 17:54 +0200
http://bitbucket.org/pypy/pypy/changeset/c967ca439384/

Log:	fix for test_file

diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py
--- a/pypy/module/_cffi_backend/test/_backend_test_c.py
+++ b/pypy/module/_cffi_backend/test/_backend_test_c.py
@@ -3518,9 +3518,9 @@
 def test_rawstring():
     BChar = new_primitive_type("char")
     BArray = new_array_type(new_pointer_type(BChar), 10)   # char[10]
-    p = newp(BArray, "abc\x00def")
-    assert rawstring(p) == "abc\x00def\x00\x00\x00"
-    assert rawstring(p[1:6]) == "bc\x00de"
+    p = newp(BArray, b"abc\x00def")
+    assert rawstring(p) == b"abc\x00def\x00\x00\x00"
+    assert rawstring(p[1:6]) == b"bc\x00de"
     BWChar = new_primitive_type("wchar_t")
     BArray = new_array_type(new_pointer_type(BWChar), 10)   # wchar_t[10]
     p = newp(BArray, u"abc\x00def")
@@ -3529,7 +3529,7 @@
     BChar = new_primitive_type("uint8_t")
     BArray = new_array_type(new_pointer_type(BChar), 10)   # uint8_t[10]
     p = newp(BArray, [65 + i for i in range(10)])
-    assert rawstring(p) == "ABCDEFGHIJ"
+    assert rawstring(p) == b"ABCDEFGHIJ"
     #
     py.test.raises(TypeError, rawstring, "foobar")
     py.test.raises(TypeError, rawstring, p + 1)


More information about the pypy-commit mailing list