Commits

Amaury Forgeot d'Arc  committed b27f195

Fix translation and update comment

  • Participants
  • Parent commits 3b9f551
  • Branches fast-forward

Comments (0)

Files changed (1)

File pypy/module/_rawffi/callback.py

     argtypes = callback_ptr.argtypes
     space = callback_ptr.space
     try:
-        # XXX The app-level callback gets the arguments as a list of integers.
-        #     Irregular interface here.  Shows something, I say.
         args_w = [None] * len(argtypes)
         for i in range(len(argtypes)):
             argtype = argtypes[i]
             if isinstance(argtype, W_Structure):
-                args_w[i] = space.wrap(argtype.fromaddress(
-                    space, rffi.cast(rffi.SIZE_T, ll_args[i])))
+                args_w[i] = argtype.fromaddress(
+                    space, rffi.cast(rffi.SIZE_T, ll_args[i]))
             else:
+                # XXX other types?
                 args_w[i] = space.wrap(rffi.cast(rffi.ULONG, ll_args[i]))
-        w_res = space.call_function(w_callable, *args_w)
+        w_res = space.call(w_callable, space.newtuple(args_w))
         if callback_ptr.result is not None: # don't return void
             unwrap_value(space, push_elem, ll_res, 0,
                          callback_ptr.result, w_res)