summaryrefslogtreecommitdiff
path: root/numpy/distutils/mingw32ccompiler.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-12-23 04:11:12 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-12-23 04:11:12 +0000
commit31c520d78424bb35e2b7863ae0c727c20091b19a (patch)
tree4dbbec3c2605e05fc7b908c4dd222a39aec743d9 /numpy/distutils/mingw32ccompiler.py
parentb5bb3605066e06dd522ed0d32bfde9292d104110 (diff)
downloadnumpy-31c520d78424bb35e2b7863ae0c727c20091b19a.tar.gz
Use msvcrt values if available for manifest generation: only there starting from python 2.6.1.
Diffstat (limited to 'numpy/distutils/mingw32ccompiler.py')
-rw-r--r--numpy/distutils/mingw32ccompiler.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py
index f58d97e49..d4f2a19cd 100644
--- a/numpy/distutils/mingw32ccompiler.py
+++ b/numpy/distutils/mingw32ccompiler.py
@@ -244,7 +244,17 @@ def build_import_library():
# XXX: ideally, we should use exactly the same version as used by python, but I
# have no idea how to obtain the exact version from python. We could use the
# strings utility on python.exe, maybe ?
-_MSVCRVER_TO_FULLVER = {'90': "9.0.21022.8"}
+try:
+ import msvcrt
+ if hasattr(msvcrt, "CRT_ASSEMBLY_VERSION"):
+ _MSVCRVER_TO_FULLVER = {'90': msvcrt.CRT_ASSEMBLY_VERSION}
+ else:
+ _MSVCRVER_TO_FULLVER = {'90': "9.0.21022.8"}
+except ImportError:
+ # If we are here, means python was not built with MSVC. Not sure what to do
+ # in that case: manifest building will fail, but it should not be used in
+ # that case anyway
+ log.warn('Cannot import msvcrt: using manifest will not be possible')
def msvc_manifest_xml(maj, min):
"""Given a major and minor version of the MSVCR, returns the