Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r63740:b6db8a247eae
Date: 2013-04-28 16:04 -0700
http://bitbucket.org/pypy/pypy/changeset/b6db8a247eae/

Log:    fix test_c.test_wchar, re-decode the repr data on the way back out

diff --git a/pypy/module/_cffi_backend/cdataobj.py 
b/pypy/module/_cffi_backend/cdataobj.py
--- a/pypy/module/_cffi_backend/cdataobj.py
+++ b/pypy/module/_cffi_backend/cdataobj.py
@@ -42,16 +42,16 @@
 
     def repr(self):
         extra2 = self._repr_extra()
-        extra1 = ''
+        extra1 = u''
         if not isinstance(self, W_CDataNewOwning):
             # it's slightly confusing to get "<cdata 'struct foo' 0x...>"
             # because the struct foo is not owned.  Trying to make it
             # clearer, write in this case "<cdata 'struct foo &' 0x...>".
             from pypy.module._cffi_backend import ctypestruct
             if isinstance(self.ctype, ctypestruct.W_CTypeStructOrUnion):
-                extra1 = ' &'
-        return self.space.wrap("<cdata '%s%s' %s>" % (
-            self.ctype.name, extra1, extra2))
+                extra1 = u' &'
+        return self.space.wrap(u"<cdata '%s%s' %s>" % (
+            self.ctype.name.decode('utf-8'), extra1, extra2.decode('utf-8')))
 
     def bool(self):
         return self.space.wrap(bool(self._cdata))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to