[pypy-commit] pypy win32-cleanup2: refactor compiler search a bit

mattip noreply at buildbot.pypy.org
Fri Mar 30 13:22:12 CEST 2012


Author: Matti Picus <matti.picus at gmail.com>
Branch: win32-cleanup2
Changeset: r54100:a86eea58d38b
Date: 2012-03-27 18:34 +0200
http://bitbucket.org/pypy/pypy/changeset/a86eea58d38b/

Log:	refactor compiler search a bit

diff --git a/lib-python/modified-2.7/ctypes/__init__.py b/lib-python/modified-2.7/ctypes/__init__.py
--- a/lib-python/modified-2.7/ctypes/__init__.py
+++ b/lib-python/modified-2.7/ctypes/__init__.py
@@ -451,6 +451,7 @@
         GetLastError = windll.kernel32.GetLastError
     else:
         GetLastError = windll.coredll.GetLastError
+    GetLastError.argtypes=[]
     from _ctypes import get_last_error, set_last_error
 
     def WinError(code=None, descr=None):
diff --git a/pypy/translator/platform/__init__.py b/pypy/translator/platform/__init__.py
--- a/pypy/translator/platform/__init__.py
+++ b/pypy/translator/platform/__init__.py
@@ -299,10 +299,11 @@
 
 def set_platform(new_platform, cc):
     global platform
-    log.msg("Setting platform to %r cc=%s" % (new_platform,cc))
     platform = pick_platform(new_platform, cc)
     if not platform:
-        raise ValueError("pick_platform failed")
+        raise ValueError("pick_platform(%r, %s) failed"%(new_platform, cc))
+    log.msg("Set platform with %r cc=%s, using cc=%r" % (new_platform, cc,
+                    getattr(platform, 'cc','Unknown')))
 
     if new_platform == 'host':
         global host
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
@@ -83,13 +83,9 @@
 
         if env is not None:
             return env
-
     log.error("Could not find a Microsoft Compiler")
     # Assume that the compiler is already part of the environment
 
-msvc_compiler_environ32 = find_msvc_env(False)
-msvc_compiler_environ64 = find_msvc_env(True)
-
 class MsvcPlatform(Platform):
     name = "msvc"
     so_ext = 'dll'
@@ -108,10 +104,7 @@
     
     def __init__(self, cc=None, x64=False):
         self.x64 = x64
-        if x64:
-            msvc_compiler_environ = msvc_compiler_environ64
-        else:
-            msvc_compiler_environ = msvc_compiler_environ32
+        msvc_compiler_environ = find_msvc_env(x64)
         Platform.__init__(self, 'cl.exe')
         if msvc_compiler_environ:
             self.c_environ = os.environ.copy()


More information about the pypy-commit mailing list