[Python-checkins] r65834 - in python/trunk: Lib/distutils/cygwinccompiler.py Misc/NEWS

amaury.forgeotdarc python-checkins at python.org
Mon Aug 18 21:23:48 CEST 2008


Author: amaury.forgeotdarc
Date: Mon Aug 18 21:23:47 2008
New Revision: 65834

Log:
#2234 distutils failed with mingw binutils 2.18.50.20080109.
Be less strict when parsing these version numbers, 
they don't necessarily follow the python numbering scheme.


Modified:
   python/trunk/Lib/distutils/cygwinccompiler.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/distutils/cygwinccompiler.py
==============================================================================
--- python/trunk/Lib/distutils/cygwinccompiler.py	(original)
+++ python/trunk/Lib/distutils/cygwinccompiler.py	Mon Aug 18 21:23:47 2008
@@ -404,7 +404,7 @@
     """ 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
 
@@ -415,7 +415,7 @@
         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:
@@ -427,7 +427,7 @@
         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:
@@ -439,7 +439,7 @@
         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:

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Mon Aug 18 21:23:47 2008
@@ -48,6 +48,10 @@
 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 #2235: Added Py3k warnings for types which will become unhashable
   under the stricter __hash__ inheritance rules in 3.0. Several types
   which did not meet the rules for hash invariants and were already


More information about the Python-checkins mailing list