[pypy-svn] pypy jitypes2: teach how to convert non-unicode chars. This fixes test_cfuncs.test_ulong_plus

antocuni commits-noreply at bitbucket.org
Tue Dec 28 10:00:07 CET 2010


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r40254:96e17cbe5ed0
Date: 2010-12-28 09:47 +0100
http://bitbucket.org/pypy/pypy/changeset/96e17cbe5ed0/

Log:	teach how to convert non-unicode chars. This fixes
	test_cfuncs.test_ulong_plus

diff --git a/lib_pypy/_ctypes/function.py b/lib_pypy/_ctypes/function.py
--- a/lib_pypy/_ctypes/function.py
+++ b/lib_pypy/_ctypes/function.py
@@ -396,7 +396,7 @@
         newargs = []
         # XXX: investigate the difference between _ffishape and _ffiargshape
         for argtype, arg in zip(argtypes, args):
-            if argtype._ffishape == 'u':
+            if argtype._ffishape == 'u' or argtype._ffishape == 'c':
                 # XXX: who should do this conversion? Maybe _ffi?
                 value = arg.value
                 assert isinstance(value, basestring) and len(value) == 1


More information about the Pypy-commit mailing list