Commit 478e78ef authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Issue #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.

Backport of r65834
parent 5533c2df
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment