Author: Richard Plangger <[email protected]>
Branch: strbuf-as-buffer
Changeset: r2833:d2c09e27ecde
Date: 2016-12-09 16:24 +0100
http://bitbucket.org/cffi/cffi/changeset/d2c09e27ecde/

Log:    do not allow unicode to directly be passed to from_buffer

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3426,11 +3426,11 @@
     BCharA = new_array_type(BCharP, None)
     p1 = from_buffer(BCharA, b"foo")
     assert p1 == from_buffer(BCharA, b"foo")
+    py.test.raises(TypeError, from_buffer, BCharA, u+"foo")
     try:
         from __builtin__ import buffer
     except ImportError:
-        # python3 does not allow from to get buffer from unicode!
-        py.test.raises(TypeError, from_buffer, BCharA, u+"foo")
+        pass
     else:
         contents = from_buffer(BCharA, buffer(b"foo"))
         for i in range(len(contents)):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to