Author: Armin Rigo <[email protected]> Branch: Changeset: r1853:ee5aa6781207 Date: 2015-04-26 18:37 +0200 http://bitbucket.org/cffi/cffi/changeset/ee5aa6781207/
Log: Obscure workaround for https://bugs.python.org/issue23246 on Python 2.7.9 diff --git a/cffi/ffiplatform.py b/cffi/ffiplatform.py --- a/cffi/ffiplatform.py +++ b/cffi/ffiplatform.py @@ -1,4 +1,4 @@ -import os +import sys, os class VerificationError(Exception): @@ -14,6 +14,15 @@ 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): from distutils.core import Extension allsources = [srcfilename] @@ -37,6 +46,7 @@ def _build(tmpdir, ext): # XXX compact but horrible :-( + _hack_at_distutils() from distutils.core import Distribution import distutils.errors # _______________________________________________ pypy-commit mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-commit
