[pypy-commit] cffi default: remove _hack_at_distutils which imports setuptools on win32, it has too many side effects.

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


Author: mattip <matti.picus at gmail.com>
Branch: 
Changeset: r2336:51f1337c9b4c
Date: 2015-10-11 23:10 +0300
http://bitbucket.org/cffi/cffi/changeset/51f1337c9b4c/

Log:	remove _hack_at_distutils which imports setuptools on win32, it has
	too many side effects.

	Not needed since 1.0 since developers can distribute binary
	packages, even on win32

diff --git a/cffi/ffiplatform.py b/cffi/ffiplatform.py
--- a/cffi/ffiplatform.py
+++ b/cffi/ffiplatform.py
@@ -14,17 +14,7 @@
 LIST_OF_FILE_NAMES = ['sources', 'include_dirs', 'library_dirs',
                       'extra_objects', 'depends']
 
-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
-
 def get_extension(srcfilename, modname, sources=(), **kwds):
-    _hack_at_distutils()   # *before* the following import
     from distutils.core import Extension
     allsources = [srcfilename]
     allsources.extend(sources)
@@ -47,7 +37,6 @@
 
 def _build(tmpdir, ext):
     # XXX compact but horrible :-(
-    _hack_at_distutils()
     from distutils.core import Distribution
     import distutils.errors
     #


More information about the pypy-commit mailing list