#2834: Change re module semantics, so that str and bytes mixing is forbidden,
and str (unicode) patterns get full unicode matching by default. The re.ASCII
flag is also introduced to ask for ASCII matching instead.
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index 48875230..da2c74a 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -409,7 +409,7 @@
out = os.popen(gcc_exe + ' -dumpversion','r')
out_string = out.read()
out.close()
- result = re.search('(\d+\.\d+(\.\d+)*)',out_string)
+ result = re.search('(\d+\.\d+(\.\d+)*)', out_string, re.ASCII)
if result:
gcc_version = StrictVersion(result.group(1))
else:
@@ -421,7 +421,7 @@
out = os.popen(ld_exe + ' -v','r')
out_string = out.read()
out.close()
- result = re.search('(\d+\.\d+(\.\d+)*)',out_string)
+ result = re.search('(\d+\.\d+(\.\d+)*)', out_string, re.ASCII)
if result:
ld_version = StrictVersion(result.group(1))
else:
@@ -433,7 +433,7 @@
out = os.popen(dllwrap_exe + ' --version','r')
out_string = out.read()
out.close()
- result = re.search(' (\d+\.\d+(\.\d+)*)',out_string)
+ result = re.search(' (\d+\.\d+(\.\d+)*)', out_string, re.ASCII)
if result:
dllwrap_version = StrictVersion(result.group(1))
else: