[pypy-commit] cffi default: document hack removal, leave hack in place for backward compatability with verify()

mattip noreply at buildbot.pypy.org
Tue Oct 13 23:44:38 CEST 2015


Author: mattip <matti.picus at gmail.com>
Branch: 
Changeset: r2337:46f1c764af88
Date: 2015-10-13 23:59 +0300
http://bitbucket.org/cffi/cffi/changeset/46f1c764af88/

Log:	document hack removal, leave hack in place for backward
	compatability with verify()

diff --git a/cffi/verifier.py b/cffi/verifier.py
--- a/cffi/verifier.py
+++ b/cffi/verifier.py
@@ -22,6 +22,15 @@
                 s = s.encode('ascii')
             super(NativeIO, self).write(s)
 
+def _hack_at_distutils():
+    # Windows-only workaround for some configurations: see
+    # https://bugs.python.org/issue23246 (Python 2.7.9)
+    if sys.platform == "win32":
+        try:
+            import setuptools    # for side-effects, patches distutils
+        except ImportError:
+            pass
+
 
 class Verifier(object):
 
@@ -112,6 +121,7 @@
         return basename
 
     def get_extension(self):
+        _hack_at_distutils() # backward compatibility hack
         if not self._has_source:
             with self.ffi._lock:
                 if not self._has_source:
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -137,6 +137,10 @@
 
 The recommended C compiler compatible with Python 2.7 is this one:
 http://www.microsoft.com/en-us/download/details.aspx?id=44266
+There is a known problem with distutils on Python 2.7.9, as 
+explained in https://bugs.python.org/issue23246, and the same 
+problem applies whenever you want to run compile() to build a dll.
+``import setuptools`` might help, but YMMV
 
 For Python 3.4 and beyond:
 https://www.visualstudio.com/en-us/downloads/visual-studio-2015-ctp-vs
@@ -146,7 +150,8 @@
 ++++++++++
 
 Win64 received very basic testing and we applied a few essential
-fixes in cffi 0.7.  Please report any other issue.
+fixes in cffi 0.7. The comment above applies for Python 2.7 on 
+Windows 64 as well. Please report any other issue.
 
 Note as usual that this is only about running the 64-bit version of
 Python on the 64-bit OS.  If you're running the 32-bit version (the


More information about the pypy-commit mailing list