diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/distutils/mingw32ccompiler.py | 15 | ||||
-rw-r--r-- | numpy/distutils/msvccompiler.py | 4 |
2 files changed, 14 insertions, 5 deletions
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py index 65fd2cc82..870df0693 100644 --- a/numpy/distutils/mingw32ccompiler.py +++ b/numpy/distutils/mingw32ccompiler.py @@ -348,15 +348,24 @@ def build_msvcr_library(debug=False): if os.name != 'nt': return False - msvcr_name = msvc_runtime_library() + # If the version number is None, then we couldn't find the MSVC runtime at + # all, because we are running on a Python distribution which is customed + # compiled; trust that the compiler is the same as the one available to us + # now, and that it is capable of linking with the correct runtime without + # any extra options. + msvcr_ver = msvc_runtime_major() + if msvcr_ver is None: + log.debug('Skip building import library: ' + 'Runtime is not compiled with MSVC') + return False # Skip using a custom library for versions < MSVC 8.0 - msvcr_ver = msvc_runtime_major() - if msvcr_ver and msvcr_ver < 80: + if msvcr_ver < 80: log.debug('Skip building msvcr library:' ' custom functionality not present') return False + msvcr_name = msvc_runtime_library() if debug: msvcr_name += 'd' diff --git a/numpy/distutils/msvccompiler.py b/numpy/distutils/msvccompiler.py index 575013a11..903d75188 100644 --- a/numpy/distutils/msvccompiler.py +++ b/numpy/distutils/msvccompiler.py @@ -42,12 +42,12 @@ class MSVCCompiler(_MSVCCompiler): def __init__(self, verbose=0, dry_run=0, force=0): _MSVCCompiler.__init__(self, verbose, dry_run, force) - def initialize(self, plat_name=None): + def initialize(self): # The 'lib' and 'include' variables may be overwritten # by MSVCCompiler.initialize, so save them for later merge. environ_lib = os.getenv('lib', '') environ_include = os.getenv('include', '') - _MSVCCompiler.initialize(self, plat_name) + _MSVCCompiler.initialize(self) # Merge current and previous values of 'lib' and 'include' os.environ['lib'] = _merge(environ_lib, os.environ['lib']) |