mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fixed #6438: distutils.cygwinccompiler.get_versions was trying to use a re string pattern on a bytes
This commit is contained in:
parent
1bbb19aad2
commit
c9e6cecdce
3 changed files with 17 additions and 10 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue