]> granicus.if.org Git - python/commitdiff
Issue #2234: distutils failed with mingw binutils 2.18.50.20080109.
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 18 Aug 2008 19:33:42 +0000 (19:33 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 18 Aug 2008 19:33:42 +0000 (19:33 +0000)
Be less strict when parsing these version numbers,
they don't necessarily follow the python numbering scheme.

Backport of r65834

Lib/distutils/cygwinccompiler.py
Misc/NEWS

index 4fd23e6dc60724d43ba378f2b8d6d65ae1a05833..6d1ba16be6dd7728a3ab0a6c0f29c63735569917 100644 (file)
@@ -398,7 +398,7 @@ def get_versions():
     """ Try to find out the versions of gcc, ld and dllwrap.
         If not possible it returns None for it.
     """
-    from distutils.version import StrictVersion
+    from distutils.version import LooseVersion
     from distutils.spawn import find_executable
     import re
 
@@ -409,7 +409,7 @@ def get_versions():
         out.close()
         result = re.search('(\d+\.\d+(\.\d+)*)',out_string)
         if result:
-            gcc_version = StrictVersion(result.group(1))
+            gcc_version = LooseVersion(result.group(1))
         else:
             gcc_version = None
     else:
@@ -421,7 +421,7 @@ def get_versions():
         out.close()
         result = re.search('(\d+\.\d+(\.\d+)*)',out_string)
         if result:
-            ld_version = StrictVersion(result.group(1))
+            ld_version = LooseVersion(result.group(1))
         else:
             ld_version = None
     else:
@@ -433,7 +433,7 @@ def get_versions():
         out.close()
         result = re.search(' (\d+\.\d+(\.\d+)*)',out_string)
         if result:
-            dllwrap_version = StrictVersion(result.group(1))
+            dllwrap_version = LooseVersion(result.group(1))
         else:
             dllwrap_version = None
     else:
index 23c2384eb6790d72a33732569eb071daed47c4c7..954ae7e4ad3952517ff1b922df73e311f3ee5198 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -77,6 +77,10 @@ Core and builtins
 Library
 -------
 
+- Issue #2234: distutils failed for some versions of the cygwin compiler. The
+  version reported by these tools does not necessarily follow the python
+  version numbering scheme, so the module is less strict when parsing it.
+
 - Issue #2222: Fixed reference leak when occured os.rename()
   fails unicode conversion on 2nd parameter. (windows only)