summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/cygwinccompiler.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-07-12 08:39:08 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-07-12 08:39:08 (GMT)
commit41fe28220bf2790277f9a82446c73736709378c6 (patch)
tree646673b3a731026f57187d3157c84d4a38edb1cb /Lib/distutils/cygwinccompiler.py
parent24448fa86e3a82b266b2abca2fae94f6d9340dae (diff)
downloadcpython-41fe28220bf2790277f9a82446c73736709378c6.zip
cpython-41fe28220bf2790277f9a82446c73736709378c6.tar.gz
cpython-41fe28220bf2790277f9a82446c73736709378c6.tar.bz2
Merged revisions 73975 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r73975 | tarek.ziade | 2009-07-12 10:27:26 +0200 (Sun, 12 Jul 2009) | 1 line Fixed #6438: distutils.cygwinccompiler.get_versions was trying to use a re string pattern on a bytes ........
Diffstat (limited to 'Lib/distutils/cygwinccompiler.py')
-rw-r--r--Lib/distutils/cygwinccompiler.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index 5f3a389..8504371 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -359,7 +359,7 @@ def check_config_h():
return (CONFIG_H_UNCERTAIN,
"couldn't read '%s': %s" % (fn, exc.strerror))
-RE_VERSION = re.compile('(\d+\.\d+(\.\d+)*)')
+RE_VERSION = re.compile(b'(\d+\.\d+(\.\d+)*)')
def _find_exe_version(cmd):
"""Find the version of an executable by running `cmd` in the shell.
@@ -378,7 +378,9 @@ def _find_exe_version(cmd):
result = RE_VERSION.search(out_string)
if result is None:
return None
- return LooseVersion(result.group(1))
+ # LooseVersion works with strings
+ # so we need to decode our bytes
+ return LooseVersion(result.group(1).decode())
def get_versions():
""" Try to find out the versions of gcc, ld and dllwrap.