Author: Wim Lavrijsen <[email protected]>
Branch: cppyy-packaging
Changeset: r91929:0b40d2587588
Date: 2017-07-18 17:42 -0700
http://bitbucket.org/pypy/pypy/changeset/0b40d2587588/

Log:    fix indirection error

diff --git a/pypy/module/_cppyy/ffitypes.py b/pypy/module/_cppyy/ffitypes.py
--- a/pypy/module/_cppyy/ffitypes.py
+++ b/pypy/module/_cppyy/ffitypes.py
@@ -82,12 +82,13 @@
 
             value = rffi.cast(rffi.CHAR, space.c_int_w(w_value))
         else:
-            value = space.bytes_w(w_value)
+            value = space.text_w(w_value)
+            if len(value) != 1:
+                raise oefmt(space.w_ValueError,
+                        "char expected, got string of size %d", len(value))
+            value = rffi.cast(rffi.CHAR, value[0])
 
-        if len(value) != 1:  
-            raise oefmt(space.w_ValueError,
-                        "char expected, got string of size %d", len(value))
-        return value[0] # turn it into a "char" to the annotator
+        return value     # turn it into a "char" to the annotator
 
     def cffi_type(self, space):
         state = space.fromcache(State)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to