[pypy-svn] pypy default: Loosen the regexp that matches the MSVC banner, to cope with translations of the version string.

amauryfa commits-noreply at bitbucket.org
Tue Feb 8 18:33:04 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r41708:3ce31c149e51
Date: 2011-02-08 18:29 +0100
http://bitbucket.org/pypy/pypy/changeset/3ce31c149e51/

Log:	Loosen the regexp that matches the MSVC banner, to cope with
	translations of the version string.

diff --git a/pypy/translator/platform/windows.py b/pypy/translator/platform/windows.py
--- a/pypy/translator/platform/windows.py
+++ b/pypy/translator/platform/windows.py
@@ -89,7 +89,7 @@
         # detect version of current compiler
         returncode, stdout, stderr = _run_subprocess(self.cc, '',
                                                      env=self.c_environ)
-        r = re.search('[Vv]ersion\W([0-9]+)\.([0-9]+)', stderr)
+        r = re.match(r'Microsoft.+C/C\+\+.+\s([0-9]+)\.([0-9]+).*', stderr)
         if r is not None:
             self.version = int(''.join(r.groups())) / 10 - 60
         else:


More information about the Pypy-commit mailing list