[pypy-svn] r79365 - pypy/branch/fast-forward/pypy/module/sys

afa at codespeak.net afa at codespeak.net
Mon Nov 22 23:08:12 CET 2010


Author: afa
Date: Mon Nov 22 23:08:10 2010
New Revision: 79365

Modified:
   pypy/branch/fast-forward/pypy/module/sys/version.py
Log:
Show GCC version in sys.version; fixes the test.


Modified: pypy/branch/fast-forward/pypy/module/sys/version.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/sys/version.py	(original)
+++ pypy/branch/fast-forward/pypy/module/sys/version.py	Mon Nov 22 23:08:10 2010
@@ -2,6 +2,7 @@
 Version numbers exposed by PyPy through the 'sys' module.
 """
 import os
+import re
 from pypy.translator.platform import platform
 
 #XXX # the release serial 42 is not in range(16)
@@ -18,6 +19,13 @@
 
 if platform.name == 'msvc':
     COMPILER_INFO = 'MSC v.%d 32 bit' % (platform.version * 10 + 600)
+elif platform.cc == '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"
 else:
     COMPILER_INFO = ""
 



More information about the Pypy-commit mailing list