[pypy-commit] cffi cffi-1.0: test and fix
arigo
noreply at buildbot.pypy.org
Sat Apr 25 14:42:53 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1824:38f60cc08b65
Date: 2015-04-25 13:02 +0200
http://bitbucket.org/cffi/cffi/changeset/38f60cc08b65/
Log: test and fix
diff --git a/_cffi1/ffi_obj.c b/_cffi1/ffi_obj.c
--- a/_cffi1/ffi_obj.c
+++ b/_cffi1/ffi_obj.c
@@ -569,7 +569,7 @@
&cdecl, &python_callable, &error))
return NULL;
- cdecl = (PyObject *)_ffi_type(self, cdecl, ACCEPT_STRING | ACCEPT_CDATA |
+ cdecl = (PyObject *)_ffi_type(self, cdecl, ACCEPT_STRING | ACCEPT_CTYPE |
CONSIDER_FN_AS_FNPTR);
if (cdecl == NULL)
return NULL;
diff --git a/_cffi1/test_ffi_obj.py b/_cffi1/test_ffi_obj.py
--- a/_cffi1/test_ffi_obj.py
+++ b/_cffi1/test_ffi_obj.py
@@ -92,7 +92,7 @@
def test_ffi_callback_decorator():
ffi = _cffi1_backend.FFI()
- assert ffi.callback("int(*)(int)")(lambda x: x + 42)(10) == 52
+ assert ffi.callback(ffi.typeof("int(*)(int)"))(lambda x: x + 42)(10) == 52
deco = ffi.callback("int(int)", error=-66)
assert deco(lambda x: x + "")(10) == -66
assert deco(lambda x: x + 42)(10) == 52
More information about the pypy-commit
mailing list