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
........
This commit is contained in:
Tarek Ziadé 2009-07-12 08:39:08 +00:00
parent 24448fa86e
commit 41fe28220b
3 changed files with 17 additions and 10 deletions

View file

@ -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.