diff options
author | Steve Dower <steve.dower@microsoft.com> | 2019-05-22 23:24:00 -0700 |
---|---|---|
committer | Aaron Robinson <arobins@microsoft.com> | 2019-05-22 23:24:00 -0700 |
commit | 1fd76b32175ad8ca9a45b203ad1a39312dd82d1e (patch) | |
tree | 42bed11b2821a5df885cec45ea140e94556d8231 | |
parent | 2eac63678471e5d993505e8586a3c4b9681a1e3f (diff) | |
download | coreclr-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>`.
-rw-r--r-- | build.cmd | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 ( |