Author: Philip Jenvey <pjen...@underboss.org>
Branch: 
Changeset: r63763:c7f8dea181b6
Date: 2013-04-29 18:53 -0700
http://bitbucket.org/pypy/pypy/changeset/c7f8dea181b6/

Log:    grab gcc and also clang info from their __VERSION__ macro

diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py
--- a/pypy/module/sys/version.py
+++ b/pypy/module/sys/version.py
@@ -15,13 +15,9 @@
 
 if platform.name == 'msvc':
     COMPILER_INFO = 'MSC v.%d 32 bit' % (platform.version * 10 + 600)
-elif platform.cc is not None and platform.cc.startswith('gcc'):
-    out = platform.execute(platform.cc, '--version').out
-    match = re.search(' (\d+\.\d+(\.\d+)*)', out)
-    if match:
-        COMPILER_INFO = "GCC " + match.group(1)
-    else:
-        COMPILER_INFO = "GCC"
+elif platform.cc is not None and platform.cc.startswith(('gcc', 'clang')):
+    from rpython.rtyper.tool import rffi_platform
+    COMPILER_INFO = 'GCC ' + rffi_platform.getdefinedstring('__VERSION__', '')
 else:
     COMPILER_INFO = ""
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to