Author: Matti Picus <[email protected]>
Branch: py3.5
Changeset: r93884:7e7871873b7f
Date: 2018-02-25 20:03 -0500
http://bitbucket.org/pypy/pypy/changeset/7e7871873b7f/

Log:    allow directly using VsDevCmd.bat for newer Visual Studio Build
        Tools installations

diff --git a/lib-python/3/distutils/msvc9compiler.py 
b/lib-python/3/distutils/msvc9compiler.py
--- a/lib-python/3/distutils/msvc9compiler.py
+++ b/lib-python/3/distutils/msvc9compiler.py
@@ -233,11 +233,17 @@
     if not productdir or not os.path.isdir(productdir):
         toolskey = "VS%0.f0COMNTOOLS" % version
         toolsdir = os.environ.get(toolskey, None)
+        batfile = 'vcvarsall.bat'
 
         if toolsdir and os.path.isdir(toolsdir):
-            productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")
-            productdir = os.path.abspath(productdir)
+            if os.path.exists(os.path.join(toolsdir, 'VsDevCmd.bat')):
+                productdir = toolsdir
+                batfile = 'VsDevCmd.bat'
+            else:
+                productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")
+                productdir = os.path.abspath(productdir)
             if not os.path.isdir(productdir):
+                
                 log.debug("%s is not a valid directory" % productdir)
                 return None
         else:
@@ -245,7 +251,7 @@
     if not productdir:
         log.debug("No productdir found")
         return None
-    vcvarsall = os.path.join(productdir, "vcvarsall.bat")
+    vcvarsall = os.path.join(productdir, batfile)
     if os.path.isfile(vcvarsall):
         return vcvarsall
     log.debug("Unable to find vcvarsall.bat")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to