Author: Matti Picus <[email protected]>
Branch: find-vcvars
Changeset: r2927:05483eaa4461
Date: 2017-04-25 20:31 +0300
http://bitbucket.org/cffi/cffi/changeset/05483eaa4461/
Log: move _hack_at_distutils from global to per-function
diff --git a/cffi/ffiplatform.py b/cffi/ffiplatform.py
--- a/cffi/ffiplatform.py
+++ b/cffi/ffiplatform.py
@@ -6,6 +6,7 @@
'extra_objects', 'depends']
def get_extension(srcfilename, modname, sources=(), **kwds):
+ _hack_at_distutils()
from distutils.core import Extension
allsources = [srcfilename]
for src in sources:
@@ -15,6 +16,7 @@
def compile(tmpdir, ext, compiler_verbose=0, debug=None):
"""Compile a C extension module using distutils."""
+ _hack_at_distutils()
saved_environ = os.environ.copy()
try:
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
@@ -123,6 +125,3 @@
import setuptools # for side-effects, patches distutils
except ImportError:
pass
-
-# this must be done before get_extension() and before compile()
-_hack_at_distutils()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit