[Python-checkins] bpo-30450: Don't use where, XP doesn't have it (GH-3348)

Zachary Ware webhook-mailer at python.org
Tue Sep 5 16:02:10 EDT 2017


https://github.com/python/cpython/commit/8905fb831cf7c400c479b79bb2f90bfbe9c71337
commit: 8905fb831cf7c400c479b79bb2f90bfbe9c71337
branch: 2.7
author: Zachary Ware <zachary.ware at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-09-05T13:02:03-07:00
summary:

bpo-30450: Don't use where, XP doesn't have it (GH-3348)

Really this time!

files:
M PCbuild/build.bat
M PCbuild/find_msbuild.bat

diff --git a/PCbuild/build.bat b/PCbuild/build.bat
index e31056b2c00..13da4be4404 100644
--- a/PCbuild/build.bat
+++ b/PCbuild/build.bat
@@ -96,9 +96,8 @@ if "%do_pgo%" EQU "true" if "%platf%" EQU "x64" (
     )
 )
 
-if not exist "%GIT%" where git > "%TEMP%\git.loc" 2> nul && set /P GIT= < "%TEMP%\git.loc" & del "%TEMP%\git.loc"
+if "%GIT%" EQU "" set GIT=git
 if exist "%GIT%" set GITProperty=/p:GIT="%GIT%"
-if not exist "%GIT%" echo Cannot find Git on PATH & set GITProperty=
 
 rem Setup the environment
 call "%dir%find_msbuild.bat" %MSBUILD%
diff --git a/PCbuild/find_msbuild.bat b/PCbuild/find_msbuild.bat
index 2b7413fbcde..76bc9739550 100644
--- a/PCbuild/find_msbuild.bat
+++ b/PCbuild/find_msbuild.bat
@@ -26,8 +26,8 @@
 @set MSBUILD=
 
 @rem If msbuild.exe is on the PATH, assume that the user wants that one.
- at where msbuild > "%TEMP%\msbuild.loc" 2> nul && set /P MSBUILD= < "%TEMP%\msbuild.loc" & del "%TEMP%\msbuild.loc"
- at if exist "%MSBUILD%" set MSBUILD="%MSBUILD%" & (set _Py_MSBuild_Source=PATH) & goto :found
+ at msbuild /version > nul 2>&1
+ at if NOT ERRORLEVEL 9009 set MSBUILD=msbuild & (set _Py_MSBuild_Source=PATH) & goto :found
 
 @rem VS 2015 and earlier register MSBuild separately, so we can find it.
 @rem Prefer MSBuild 14.0 over MSBuild 15.0, since the latter may not be able to find a VC14 install.



More information about the Python-checkins mailing list