diff options
Diffstat (limited to 'numpy/distutils/mingw32ccompiler.py')
-rw-r--r-- | numpy/distutils/mingw32ccompiler.py | 15 |
1 files changed, 12 insertions, 3 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' |