def build_executable_cache(c_files, eci): path = cache_file_path(c_files, eci, 'build_executable_cache') try: return path.read() except py.error.Error: result = platform.execute(platform.compile(c_files, eci)) path.write(result.out) return result.out
def build_executable_cache(c_files, eci): "Builds and run a program; caches the result" # Import 'platform' every time, the compiler may have been changed from pypy.translator.platform import platform path = cache_file_path(c_files, eci, "build_executable_cache") try: return path.read() except py.error.Error: result = platform.execute(platform.compile(c_files, eci)) path.write(result.out) return result.out
def build_executable_cache(c_files, eci, ignore_errors=False): "Builds and run a program; caches the result" # Import 'platform' every time, the compiler may have been changed from pypy.translator.platform import platform path = cache_file_path(c_files, eci, 'build_executable_cache') try: return path.read() except py.error.Error: _previous = platform.log_errors try: if ignore_errors: platform.log_errors = False result = platform.execute(platform.compile(c_files, eci)) finally: if ignore_errors: del platform.log_errors # ^^^remove from the instance --- needed so that it can # compare equal to another instance without it if platform.log_errors != _previous: platform.log_errors = _previous path.write(result.out) return result.out
""" import os import re from pypy.translator.platform import platform from pypy.interpreter import gateway #XXX # the release serial 42 is not in range(16) CPYTHON_VERSION = (2, 7, 2, "final", 42) #XXX # sync patchlevel.h CPYTHON_API_VERSION = 1013 #XXX # sync with include/modsupport.h PYPY_VERSION = (1, 8, 1, "dev", 0) #XXX # sync patchlevel.h 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" else: COMPILER_INFO = "" import pypy pypydir = os.path.dirname(os.path.abspath(pypy.__file__)) del pypy from pypy.tool.version import get_repo_version_info import time as t
import os import re from pypy.translator.platform import platform from pypy.interpreter import gateway #XXX # the release serial 42 is not in range(16) CPYTHON_VERSION = (2, 7, 2, "final", 42) #XXX # sync CPYTHON_VERSION with patchlevel.h, package.py CPYTHON_API_VERSION = 1013 #XXX # sync with include/modsupport.h PYPY_VERSION = (1, 9, 0, "final", 0) #XXX # sync patchlevel.h 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" else: COMPILER_INFO = "" import pypy pypydir = os.path.dirname(os.path.abspath(pypy.__file__)) del pypy from pypy.tool.version import get_repo_version_info import time as t gmtime = t.gmtime()