[Numpy-svn] r6192 - trunk/numpy/distutils

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Dec 22 23:11:19 EST 2008


Author: cdavid
Date: 2008-12-22 22:11:12 -0600 (Mon, 22 Dec 2008)
New Revision: 6192

Modified:
   trunk/numpy/distutils/mingw32ccompiler.py
Log:
Use msvcrt values if available for manifest generation: only there starting from python 2.6.1.

Modified: trunk/numpy/distutils/mingw32ccompiler.py
===================================================================
--- trunk/numpy/distutils/mingw32ccompiler.py	2008-12-23 04:10:59 UTC (rev 6191)
+++ trunk/numpy/distutils/mingw32ccompiler.py	2008-12-23 04:11:12 UTC (rev 6192)
@@ -244,7 +244,17 @@
 # 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




More information about the Numpy-svn mailing list