[pypy-commit] pypy default: Update to cffi 1.0.2

arigo noreply at buildbot.pypy.org
Fri May 22 00:27:58 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r77465:df583f877172
Date: 2015-05-22 00:28 +0200
http://bitbucket.org/pypy/pypy/changeset/df583f877172/

Log:	Update to cffi 1.0.2

diff --git a/lib_pypy/cffi.egg-info/PKG-INFO b/lib_pypy/cffi.egg-info/PKG-INFO
--- a/lib_pypy/cffi.egg-info/PKG-INFO
+++ b/lib_pypy/cffi.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: cffi
-Version: 1.0.1
+Version: 1.0.2
 Summary: Foreign Function Interface for Python calling C code.
 Home-page: http://cffi.readthedocs.org
 Author: Armin Rigo, Maciej Fijalkowski
diff --git a/lib_pypy/cffi/__init__.py b/lib_pypy/cffi/__init__.py
--- a/lib_pypy/cffi/__init__.py
+++ b/lib_pypy/cffi/__init__.py
@@ -4,8 +4,8 @@
 from .api import FFI, CDefError, FFIError
 from .ffiplatform import VerificationError, VerificationMissing
 
-__version__ = "1.0.1"
-__version_info__ = (1, 0, 1)
+__version__ = "1.0.2"
+__version_info__ = (1, 0, 2)
 
 # The verifier module file names are based on the CRC32 of a string that
 # contains the following version number.  It may be older than __version__
diff --git a/lib_pypy/cffi/recompiler.py b/lib_pypy/cffi/recompiler.py
--- a/lib_pypy/cffi/recompiler.py
+++ b/lib_pypy/cffi/recompiler.py
@@ -581,10 +581,11 @@
 
     def _generate_cpy_function_collecttype(self, tp, name):
         self._do_collect_type(tp.as_raw_function())
-        if tp.ellipsis:
+        if tp.ellipsis and not self.target_is_python:
             self._do_collect_type(tp)
 
     def _generate_cpy_function_decl(self, tp, name):
+        assert not self.target_is_python
         assert isinstance(tp, model.FunctionPtrType)
         if tp.ellipsis:
             # cannot support vararg functions better than this: check for its
@@ -702,7 +703,7 @@
         prnt()
 
     def _generate_cpy_function_ctx(self, tp, name):
-        if tp.ellipsis:
+        if tp.ellipsis and not self.target_is_python:
             self._generate_cpy_constant_ctx(tp, name)
             return
         type_index = self._typesdict[tp.as_raw_function()]
diff --git a/pypy/module/_cffi_backend/__init__.py b/pypy/module/_cffi_backend/__init__.py
--- a/pypy/module/_cffi_backend/__init__.py
+++ b/pypy/module/_cffi_backend/__init__.py
@@ -2,7 +2,7 @@
 from pypy.interpreter.mixedmodule import MixedModule
 from rpython.rlib import rdynload
 
-VERSION = "1.0.1"
+VERSION = "1.0.2"
 
 
 class Module(MixedModule):
diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py
--- a/pypy/module/_cffi_backend/test/_backend_test_c.py
+++ b/pypy/module/_cffi_backend/test/_backend_test_c.py
@@ -3335,4 +3335,4 @@
 
 def test_version():
     # this test is here mostly for PyPy
-    assert __version__ == "1.0.1"
+    assert __version__ == "1.0.2"
diff --git a/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_re_python.py b/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_re_python.py
--- a/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_re_python.py
+++ b/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_re_python.py
@@ -13,6 +13,7 @@
     #define BIGPOS 420000000000L
     #define BIGNEG -420000000000L
     int add42(int x) { return x + 42; }
+    int add43(int x, ...) { return x; }
     int globalvar42 = 1234;
     struct foo_s;
     typedef struct bar_s { int x; signed char a[]; } bar_t;
@@ -38,6 +39,7 @@
     #define BIGPOS 420000000000L
     #define BIGNEG -420000000000L
     int add42(int);
+    int add43(int, ...);
     int globalvar42;
     int no_such_function(int);
     int no_such_globalvar;
@@ -69,6 +71,13 @@
     assert lib.add42(-10) == 32
     assert type(lib.add42) is _cffi_backend.FFI.CData
 
+def test_function_with_varargs():
+    import _cffi_backend
+    from re_python_pysrc import ffi
+    lib = ffi.dlopen(extmod)
+    assert lib.add43(45, ffi.cast("int", -5)) == 45
+    assert type(lib.add43) is _cffi_backend.FFI.CData
+
 def test_dlclose():
     import _cffi_backend
     from re_python_pysrc import ffi


More information about the pypy-commit mailing list