summaryrefslogtreecommitdiff
path: root/build.cmd
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2019-05-22 23:24:00 -0700
committerAaron Robinson <arobins@microsoft.com>2019-05-22 23:24:00 -0700
commit1fd76b32175ad8ca9a45b203ad1a39312dd82d1e (patch)
tree42bed11b2821a5df885cec45ea140e94556d8231 /build.cmd
parent2eac63678471e5d993505e8586a3c4b9681a1e3f (diff)
downloadcoreclr-1fd76b32175ad8ca9a45b203ad1a39312dd82d1e.tar.gz
coreclr-1fd76b32175ad8ca9a45b203ad1a39312dd82d1e.tar.bz2
coreclr-1fd76b32175ad8ca9a45b203ad1a39312dd82d1e.zip
Use -c when trying to find Python (#24722)
Piping code into Python is indistinguishable from interactive execution, but since we never want interactive execution here it's better to use `-c <CODE>`.
Diffstat (limited to 'build.cmd')
-rw-r--r--build.cmd4
1 files changed, 3 insertions, 1 deletions
diff --git a/build.cmd b/build.cmd
index f61df16b22..3b1ff66b49 100644
--- a/build.cmd
+++ b/build.cmd
@@ -411,7 +411,9 @@ set __IntermediatesIncDir=%__IntermediatesDir%\src\inc
set __IntermediatesEventingDir=%__IntermediatesDir%\Eventing
REM Find python and set it to the variable PYTHON
-echo import sys; sys.stdout.write(sys.executable) | (py -3 || py -2 || python3 || python2 || python) > %TEMP%\pythonlocation.txt 2> NUL
+set _C=-c "import sys; sys.stdout.write(sys.executable)"
+(py -3 %_C% || py -2 %_C% || python3 %_C% || python2 %_C% || python %_C%) > %TEMP%\pythonlocation.txt 2> NUL
+set _C=
set /p PYTHON=<%TEMP%\pythonlocation.txt
if NOT DEFINED PYTHON (