Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r2169:5c10cf136437
Date: 2015-06-07 15:22 +0200
http://bitbucket.org/cffi/cffi/changeset/5c10cf136437/

Log:    hg merge release-1.1

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -6063,7 +6063,7 @@
     if (v == NULL || PyModule_AddObject(m, "_C_API", v) < 0)
         INITERROR;
 
-    v = PyText_FromString("1.1.0");
+    v = PyText_FromString("1.1.1");
     if (v == NULL || PyModule_AddObject(m, "__version__", v) < 0)
         INITERROR;
 
diff --git a/c/lib_obj.c b/c/lib_obj.c
--- a/c/lib_obj.c
+++ b/c/lib_obj.c
@@ -300,7 +300,7 @@
     case _CFFI_OP_GLOBAL_VAR:
     {
         /* global variable of the exact type specified here */
-        size_t g_size = (size_t)g->size_or_direct_fn;
+        Py_ssize_t g_size = (Py_ssize_t)g->size_or_direct_fn;
         ct = realize_c_type(types_builder, types_builder->ctx.types,
                             _CFFI_GETARG(g->type_op));
         if (ct == NULL)
diff --git a/c/realize_c_type.c b/c/realize_c_type.c
--- a/c/realize_c_type.c
+++ b/c/realize_c_type.c
@@ -60,7 +60,7 @@
 static void free_builder_c(builder_c_t *builder, int ctx_is_static)
 {
     if (!ctx_is_static) {
-        int i;
+        size_t i;
         const void *mem[] = {builder->ctx.types,
                              builder->ctx.globals,
                              builder->ctx.struct_unions,
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3346,4 +3346,4 @@
 
 def test_version():
     # this test is here mostly for PyPy
-    assert __version__ == "1.1.0"
+    assert __version__ == "1.1.1"
diff --git a/cffi/__init__.py b/cffi/__init__.py
--- a/cffi/__init__.py
+++ b/cffi/__init__.py
@@ -4,8 +4,8 @@
 from .api import FFI, CDefError, FFIError
 from .ffiplatform import VerificationError, VerificationMissing
 
-__version__ = "1.1.0"
-__version_info__ = (1, 1, 0)
+__version__ = "1.1.1"
+__version_info__ = (1, 1, 1)
 
 # 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/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -47,7 +47,7 @@
 # The short X.Y version.
 version = '1.1'
 # The full version, including alpha/beta/rc tags.
-release = '1.1.0'
+release = '1.1.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -51,13 +51,13 @@
 
 Download and Installation:
 
-* http://pypi.python.org/packages/source/c/cffi/cffi-1.1.0.tar.gz
+* http://pypi.python.org/packages/source/c/cffi/cffi-1.1.1.tar.gz
 
    - Or grab the most current version by following the instructions below.
 
-   - MD5: b58d43a708e757f63a905c6a0d9ecf7a
+   - MD5: f397363bfbf99048accb0498ffc3e72b
 
-   - SHA: 7c36b783156eaf985b35a56c43f3eecac37e262c
+   - SHA: 8c4f4d1078d05c796c12fc6d8f8cea25aaff0148
 
 * Or get it from the `Bitbucket page`_:
   ``hg clone https://bitbucket.org/cffi/cffi``
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -144,7 +144,7 @@
 
 `Mailing list <https://groups.google.com/forum/#!forum/python-cffi>`_
 """,
-        version='1.1.0',
+        version='1.1.1',
         packages=['cffi'] if cpython else [],
         package_data={'cffi': ['_cffi_include.h', 'parse_c_type.h']}
                      if cpython else {},
diff --git a/testing/cffi0/test_zintegration.py 
b/testing/cffi0/test_zintegration.py
--- a/testing/cffi0/test_zintegration.py
+++ b/testing/cffi0/test_zintegration.py
@@ -1,5 +1,4 @@
 import py, os, sys, shutil
-import imp
 import subprocess
 from testing.udir import udir
 
@@ -15,28 +14,12 @@
     except OSError as e:
         py.test.skip("Cannot execute virtualenv: %s" % (e,))
 
-    try:
-        deepcopy = os.symlink
-    except:
-        import shutil, errno
-        def deepcopy(src, dst):
-            try:
-                shutil.copytree(src, dst)
-            except OSError as e:
-                if e.errno in (errno.ENOTDIR, errno.EINVAL):
-                    shutil.copy(src, dst)
-                else:
-                    print('got errno')
-                    print(e.errno)
-                    print('not')
-                    print(errno.ENOTDIR)
-                    raise
-
     site_packages = None
     for dirpath, dirnames, filenames in os.walk(str(tmpdir)):
         if os.path.basename(dirpath) == 'site-packages':
             site_packages = dirpath
             break
+    paths = ""
     if site_packages:
         try:
             from cffi import _pycparser
@@ -49,15 +32,22 @@
                 pass
             else:
                 modules += ('ply',)   # needed for older versions of pycparser
+        paths = []
         for module in modules:
-            target = imp.find_module(module)[1]
-            deepcopy(target, os.path.join(site_packages,
-                                            os.path.basename(target)))
-    return tmpdir
+            target = __import__(module, None, None, [])
+            src = os.path.abspath(target.__file__)
+            for end in ['__init__.pyc', '__init__.pyo', '__init__.py']:
+                if src.lower().endswith(end):
+                    src = src[:-len(end)-1]
+                    break
+            paths.append(os.path.dirname(src))
+        paths = os.pathsep.join(paths)
+    return tmpdir, paths
 
 SNIPPET_DIR = py.path.local(__file__).join('..', 'snippets')
 
-def really_run_setup_and_program(dirname, venv_dir, python_snippet):
+def really_run_setup_and_program(dirname, venv_dir_and_paths, python_snippet):
+    venv_dir, paths = venv_dir_and_paths
     def remove(dir):
         dir = str(SNIPPET_DIR.join(dirname, dir))
         shutil.rmtree(dir, ignore_errors=True)
@@ -75,9 +65,11 @@
         else:
             bindir = 'bin'
         vp = str(venv_dir.join(bindir).join('python'))
-        subprocess.check_call((vp, 'setup.py', 'clean'))
-        subprocess.check_call((vp, 'setup.py', 'install'))
-        subprocess.check_call((vp, str(python_f)))
+        env = os.environ.copy()
+        env['PYTHONPATH'] = paths
+        subprocess.check_call((vp, 'setup.py', 'clean'), env=env)
+        subprocess.check_call((vp, 'setup.py', 'install'), env=env)
+        subprocess.check_call((vp, str(python_f)), env=env)
     finally:
         os.chdir(olddir)
 
diff --git a/testing/cffi1/test_ffi_obj.py b/testing/cffi1/test_ffi_obj.py
--- a/testing/cffi1/test_ffi_obj.py
+++ b/testing/cffi1/test_ffi_obj.py
@@ -159,9 +159,10 @@
                             "struct never_heard_of_s\n"
                             "       ^")
     e = py.test.raises(ffi.error, ffi.cast, "\t\n\x01\x1f~\x7f\x80\xff", 0)
+    marks = "?" if sys.version_info < (3,) else "??"
     assert str(e.value) == ("identifier expected\n"
-                            "  ??~???\n"
-                            "  ^")
+                            "  ??~?%s%s\n"
+                            "  ^" % (marks, marks))
     e = py.test.raises(ffi.error, ffi.cast, "X" * 600, 0)
     assert str(e.value) == ("undefined type name")
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to