[pypy-commit] pypy space-newtext: fix the annoying wrap in _rawffi

cfbolz pypy.commits at gmail.com
Tue Nov 29 05:47:08 EST 2016


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: space-newtext
Changeset: r88732:f8751e58e3a8
Date: 2016-11-29 10:39 +0100
http://bitbucket.org/pypy/pypy/changeset/f8751e58e3a8/

Log:	fix the annoying wrap in _rawffi

diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py
--- a/pypy/module/_rawffi/interp_rawffi.py
+++ b/pypy/module/_rawffi/interp_rawffi.py
@@ -441,13 +441,16 @@
             if c in TYPEMAP_PTR_LETTERS:
                 res = func(add_arg, argdesc, rffi.VOIDP)
                 return space.newint(rffi.cast(lltype.Unsigned, res))
+            if c in TYPEMAP_NUMBER_LETTERS:
+                return space.newint(func(add_arg, argdesc, ll_type))
             elif c == 'c':
                 return space.newbytes(func(add_arg, argdesc, ll_type))
+            elif c == 'u':
+                return space.newunicode(func(add_arg, argdesc, ll_type))
             elif c == 'f' or c == 'd' or c == 'g':
                 return space.newfloat(float(func(add_arg, argdesc, ll_type)))
             else:
-                # YYY hard
-                return space.wrap(func(add_arg, argdesc, ll_type))
+                assert 0, "unreachable"
     raise oefmt(space.w_TypeError, "cannot directly read value")
 
 NARROW_INTEGER_TYPES = 'cbhiBIH?'


More information about the pypy-commit mailing list