[pypy-commit] pypy release-2.6.x: merge default into release (for documenting release)

mattip noreply at buildbot.pypy.org
Sun May 31 16:39:08 CEST 2015


Author: mattip <matti.picus at gmail.com>
Branch: release-2.6.x
Changeset: r77723:2e2cefca41a7
Date: 2015-05-31 17:26 +0300
http://bitbucket.org/pypy/pypy/changeset/2e2cefca41a7/

Log:	merge default into release (for documenting release)

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -13,3 +13,5 @@
 fcdb941565156385cbac04cfb891f8f4c7a92ef6 release-2.6.0
 fcdb941565156385cbac04cfb891f8f4c7a92ef6 release-2.6.0
 e03971291f3a0729ecd3ee7fae7ddb0bb82d476c release-2.6.0
+e03971291f3a0729ecd3ee7fae7ddb0bb82d476c release-2.6.0
+295ee98b69288471b0fcf2e0ede82ce5209eb90b release-2.6.0
diff --git a/pypy/module/_cffi_backend/ctypeobj.py b/pypy/module/_cffi_backend/ctypeobj.py
--- a/pypy/module/_cffi_backend/ctypeobj.py
+++ b/pypy/module/_cffi_backend/ctypeobj.py
@@ -1,3 +1,4 @@
+import sys
 from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError, oefmt
 from pypy.interpreter.gateway import interp2app
@@ -131,6 +132,8 @@
             # obscure hack when untranslated, maybe, approximate, don't use
             if isinstance(align, llmemory.FieldOffset):
                 align = rffi.sizeof(align.TYPE.y)
+                if (1 << (8*align-2)) > sys.maxint:
+                    align /= 2
         else:
             # a different hack when translated, to avoid seeing constants
             # of a symbolic integer type
diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py b/pypy/module/_cffi_backend/test/test_recompiler.py
--- a/pypy/module/_cffi_backend/test/test_recompiler.py
+++ b/pypy/module/_cffi_backend/test/test_recompiler.py
@@ -29,7 +29,7 @@
     rdir = udir.ensure('recompiler', dir=1)
     rdir.join('Python.h').write(
         '#define PYPY_VERSION XX\n'
-        '#define PyMODINIT_FUNC /*exported*/\n'
+        '#define PyMODINIT_FUNC /*exported*/ void\n'
         )
     path = module_name.replace('.', os.sep)
     if '.' in module_name:
@@ -953,3 +953,16 @@
         ffi.typeof('function_t*')
         lib.function(ffi.NULL)
         # assert did not crash
+
+    def test_alignment_of_longlong(self):
+        import _cffi_backend
+        BULongLong = _cffi_backend.new_primitive_type('unsigned long long')
+        x1 = _cffi_backend.alignof(BULongLong)
+        assert x1 in [4, 8]
+        #
+        ffi, lib = self.prepare(
+            "struct foo_s { unsigned long long x; };",
+            'test_alignment_of_longlong',
+            "struct foo_s { unsigned long long x; };")
+        assert ffi.alignof('unsigned long long') == x1
+        assert ffi.alignof('struct foo_s') == x1
diff --git a/pypy/module/test_lib_pypy/test_curses.py b/pypy/module/test_lib_pypy/test_curses.py
--- a/pypy/module/test_lib_pypy/test_curses.py
+++ b/pypy/module/test_lib_pypy/test_curses.py
@@ -6,11 +6,12 @@
 
 # Check that lib_pypy.cffi finds the correct version of _cffi_backend.
 # Otherwise, the test is skipped.  It should never be skipped when run
-# with "pypy py.test -A".
+# with "pypy py.test -A" and _curses_build.py has been run with pypy.
 try:
-    from lib_pypy import cffi; cffi.FFI()
-except (ImportError, AssertionError), e:
-    pytest.skip("no cffi module or wrong version (%s)" % (e,))
+    from lib_pypy import _curses_cffi
+except ImportError:
+    # On CPython, "pip install cffi".  On old PyPy's, no chance
+    pytest.skip("install cffi and run lib_pypy/_curses_build.py manually first")
 
 from lib_pypy import _curses
 
diff --git a/pypy/module/test_lib_pypy/test_sqlite3.py b/pypy/module/test_lib_pypy/test_sqlite3.py
--- a/pypy/module/test_lib_pypy/test_sqlite3.py
+++ b/pypy/module/test_lib_pypy/test_sqlite3.py
@@ -313,10 +313,11 @@
             pytest.skip("_sqlite3 requires Python 2.7")
 
         try:
-            import _cffi_backend
+            from lib_pypy import _sqlite3_cffi
         except ImportError:
             # On CPython, "pip install cffi".  On old PyPy's, no chance
-            pytest.skip("_sqlite3 requires _cffi_backend to be installed")
+            pytest.skip("install cffi and run lib_pypy/_sqlite3_build.py "
+                        "manually first")
 
         global _sqlite3
         from lib_pypy import _sqlite3


More information about the pypy-commit mailing list